Started Exercises in lp3thw
This commit is contained in:
parent
a00896b2ec
commit
4e87bc4686
8
python/lp3thw/Exercise01/ex1.py
Normal file
8
python/lp3thw/Exercise01/ex1.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
print("Hello World!")
|
||||||
|
print("Hello Again")
|
||||||
|
print("I like typing this.")
|
||||||
|
print("This is fun.")
|
||||||
|
print("Yay! Printing.")
|
||||||
|
print("I'd much rather you 'not'.")
|
||||||
|
print("I \"said\" do not touch this.")
|
||||||
|
#print("This line won't print")
|
||||||
6
python/lp3thw/Exercise02/ex2.py
Normal file
6
python/lp3thw/Exercise02/ex2.py
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#The pound symbol starts a comment, anything after is is disregarded!
|
||||||
|
|
||||||
|
print("I could have code like this.") # And comments after
|
||||||
|
|
||||||
|
#print("This code won't run")\
|
||||||
|
print("This code will run")
|
||||||
16
python/lp3thw/Exercise03/ex3.py
Normal file
16
python/lp3thw/Exercise03/ex3.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
print("I will count my chickens:")
|
||||||
|
|
||||||
|
print("Hens", 25 + 30 / 6) #should print 30
|
||||||
|
print("Roosters", 100 - 25 * 3 % 4) #maybe 98?
|
||||||
|
|
||||||
|
print("Now I will count the eggs:")
|
||||||
|
print(3 + 2 + 1 -5 + 4 % 2 - 1 / 4 + 6)
|
||||||
|
|
||||||
|
print("Is it true that 3 + 2 < 5 - 7?")
|
||||||
|
|
||||||
|
print(3 + 2 < 5 - 7) #should print a boolean Ie. True/False
|
||||||
|
|
||||||
|
print("What is 3 + 2?", 3 + 2)
|
||||||
|
print("What is 5 - 7?", 5 - 7)
|
||||||
|
|
||||||
|
print("Oh, that's why it's False.")
|
||||||
0
python/lp3thw/Exercise04/ex4.py
Normal file
0
python/lp3thw/Exercise04/ex4.py
Normal file
@ -1 +1,3 @@
|
|||||||
This is "Learn Python 3 The Hard Way"
|
This is "Learn Python 3 The Hard Way"
|
||||||
|
|
||||||
|
http://www.informit.com/hardway
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user