Python 2.7.1....
#1
Posted 08 May 2011 - 05:16 AM
Can someone post some simple python scripts that I can dissect to help me learn this stuff? Any help would be appreciated.
#2
Posted 08 May 2011 - 05:17 AM
Quote
#3
Posted 08 May 2011 - 05:26 AM
#4
Posted 08 May 2011 - 05:28 AM
D3nn said:
Exactly! And when I did they started talking about terms they never explained and I got real confused
Quote
#6
Posted 08 May 2011 - 06:11 AM
D3nn said:
Did my first hello world this morning. I got the app learning python. But it's for 3.0. I've only ran into a couple of differences so far. I know if I see a few simple scripts it will help.
#7
Posted 08 May 2011 - 06:16 AM
#8
Posted 08 May 2011 - 06:26 AM
Leffy said:
Well. After your post it looks like I may need to clean my computer and load up the 3.x version. What version do most hack tools that use python have?? Anyone know?? I suspect it's 2.x.
#9
Posted 08 May 2011 - 06:27 AM
Quote
#10
Posted 08 May 2011 - 06:28 AM
Quote
#11
Posted 08 May 2011 - 06:41 AM
#12
Posted 08 May 2011 - 12:38 PM
#13
Posted 08 May 2011 - 03:20 PM
#14
Posted 08 May 2011 - 07:06 PM
print(x): print x range(x): xrange(x)
and thats the main looking differences, there are other differences but i doubt you will run into them unless you use map() and filter() which in this case in 3.x they return an iterator and in 2.x they return a list. Other then that theres new string formatting with the .format method. really those are the only differences that bothered me
#15
Posted 08 May 2011 - 07:27 PM
Quote
#16
Posted 08 May 2011 - 09:55 PM
#17
Posted 09 May 2011 - 12:26 AM
count1 = 1 count2 = 2 while count1 < count2: count1 = count1 * 2 count2 = count2 * 2 print(count1)
#18
Posted 09 May 2011 - 01:15 AM
#19
Posted 09 May 2011 - 01:21 AM
count = 1 while 1 == 1 count = count * 2 print (count)
I don't know any python so correct me if i'm wrong any where. Anytime I write code I try to do so using as few instructions as possible (hopefully thus making it more efficient)
#20
Posted 09 May 2011 - 02:03 AM











