From 4e87bc4686faa5942b0a5dc2ab8442a077d317de Mon Sep 17 00:00:00 2001 From: Ganome Date: Mon, 19 Apr 2021 16:00:08 +0000 Subject: [PATCH] Started Exercises in lp3thw --- python/lp3thw/Exercise01/ex1.py | 8 ++++++++ python/lp3thw/Exercise02/ex2.py | 6 ++++++ python/lp3thw/Exercise03/ex3.py | 16 ++++++++++++++++ python/lp3thw/Exercise04/ex4.py | 0 python/lp3thw/README.md | 2 ++ 5 files changed, 32 insertions(+) create mode 100644 python/lp3thw/Exercise01/ex1.py create mode 100644 python/lp3thw/Exercise02/ex2.py create mode 100644 python/lp3thw/Exercise03/ex3.py create mode 100644 python/lp3thw/Exercise04/ex4.py diff --git a/python/lp3thw/Exercise01/ex1.py b/python/lp3thw/Exercise01/ex1.py new file mode 100644 index 0000000..4d04fd9 --- /dev/null +++ b/python/lp3thw/Exercise01/ex1.py @@ -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") \ No newline at end of file diff --git a/python/lp3thw/Exercise02/ex2.py b/python/lp3thw/Exercise02/ex2.py new file mode 100644 index 0000000..96a652c --- /dev/null +++ b/python/lp3thw/Exercise02/ex2.py @@ -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") \ No newline at end of file diff --git a/python/lp3thw/Exercise03/ex3.py b/python/lp3thw/Exercise03/ex3.py new file mode 100644 index 0000000..d978e3d --- /dev/null +++ b/python/lp3thw/Exercise03/ex3.py @@ -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.") \ No newline at end of file diff --git a/python/lp3thw/Exercise04/ex4.py b/python/lp3thw/Exercise04/ex4.py new file mode 100644 index 0000000..e69de29 diff --git a/python/lp3thw/README.md b/python/lp3thw/README.md index 3cabbc4..e43e93e 100644 --- a/python/lp3thw/README.md +++ b/python/lp3thw/README.md @@ -1 +1,3 @@ This is "Learn Python 3 The Hard Way" + +http://www.informit.com/hardway