From c2cf70e599ec6a8e9d683d799292ef29830244cd Mon Sep 17 00:00:00 2001 From: Diego Gonzalez Franco Date: Wed, 27 Jun 2018 13:18:02 +0200 Subject: [PATCH 1/2] Add files via upload --- Project 4 - Decisions.py | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Project 4 - Decisions.py diff --git a/Project 4 - Decisions.py b/Project 4 - Decisions.py new file mode 100644 index 0000000..911f13c --- /dev/null +++ b/Project 4 - Decisions.py @@ -0,0 +1,41 @@ +#Python script with inputs, string converters, function definitions, while bucle, if and else decisions + +door = input("Choose a door: 1 or 2\n") + +def add(one, two): + return one + two + +while(door != "2" or door != "1"): + print(f"You've choosen door number {door}") + if door == "1": + print("There's a tiger behind the door.") + print("What are you going to do?") + beardecision = input("1. Hit the bear\n2. Run away\n") + if beardecision == "1": + print("Alright, you killed the bear and saved your life.") + else: + print("You cant' run from a bear, you're dead bruh.") + break + + elif door == "2": + print("There's a teacher behind the door.") + print("He asks you to tell him your age") + age = int(input("")) + print("Now he want to know your weight") + weight = int(input("")) + print("Finally he asks you to tell him what is the sum of your age and weight") + print("If you ") + print("If you fail he will kill you") + sum = int(input ("")) + correct = add(age, weight) + print(f"The correct sum is {correct}") + if (sum == correct): + print("Congrats! Your're alive") + else: + print("You failed") + print("The teacher hits you with his ruler till you die") + break + + else: + print("Bad choice") + door = input("Choose a door: 1 or 2\n") \ No newline at end of file From a7b2a4fb71bed7cac88c9256760a5f05edde7cdb Mon Sep 17 00:00:00 2001 From: Diego Gonzalez Franco Date: Wed, 27 Jun 2018 13:18:58 +0200 Subject: [PATCH 2/2] Rename Project 4 - Decisions.py to Project4-Decisions.py project 4 added --- Project 4 - Decisions.py => Project4-Decisions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename Project 4 - Decisions.py => Project4-Decisions.py (96%) diff --git a/Project 4 - Decisions.py b/Project4-Decisions.py similarity index 96% rename from Project 4 - Decisions.py rename to Project4-Decisions.py index 911f13c..3f8a2b1 100644 --- a/Project 4 - Decisions.py +++ b/Project4-Decisions.py @@ -38,4 +38,4 @@ def add(one, two): else: print("Bad choice") - door = input("Choose a door: 1 or 2\n") \ No newline at end of file + door = input("Choose a door: 1 or 2\n")