From 91da0f40105b30f1a807afa111b46639478c0303 Mon Sep 17 00:00:00 2001 From: Citrus716 <60357364+Citrus716@users.noreply.github.com> Date: Mon, 6 Jul 2020 17:21:30 -0400 Subject: [PATCH 1/5] Create Money Check --- 1_beginner/chapter4/practice/Money Check | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 1_beginner/chapter4/practice/Money Check diff --git a/1_beginner/chapter4/practice/Money Check b/1_beginner/chapter4/practice/Money Check new file mode 100644 index 00000000..a73799d5 --- /dev/null +++ b/1_beginner/chapter4/practice/Money Check @@ -0,0 +1,4 @@ +# Write a program that asks for a person's amount of money(floating point). +# If the person's amount of money is 0, print "Bankrupt". If not, print "Not Bankrupt" +# If the person's amount of money is greater than 1000.0, then print "Rich" +# Write your code here From 850b4657db3ad2d13d9254f8ea74ccc4e1cb88d1 Mon Sep 17 00:00:00 2001 From: Citrus716 <60357364+Citrus716@users.noreply.github.com> Date: Mon, 6 Jul 2020 17:23:02 -0400 Subject: [PATCH 2/5] Update and rename Money Check to money_check --- 1_beginner/chapter4/practice/{Money Check => money_check} | 1 + 1 file changed, 1 insertion(+) rename 1_beginner/chapter4/practice/{Money Check => money_check} (94%) diff --git a/1_beginner/chapter4/practice/Money Check b/1_beginner/chapter4/practice/money_check similarity index 94% rename from 1_beginner/chapter4/practice/Money Check rename to 1_beginner/chapter4/practice/money_check index a73799d5..b85f88df 100644 --- a/1_beginner/chapter4/practice/Money Check +++ b/1_beginner/chapter4/practice/money_check @@ -1,3 +1,4 @@ +# Money Check # Write a program that asks for a person's amount of money(floating point). # If the person's amount of money is 0, print "Bankrupt". If not, print "Not Bankrupt" # If the person's amount of money is greater than 1000.0, then print "Rich" From e204b38140a897868697929cc3e314759e57504e Mon Sep 17 00:00:00 2001 From: Citrus716 <60357364+Citrus716@users.noreply.github.com> Date: Tue, 7 Jul 2020 18:02:19 -0400 Subject: [PATCH 3/5] Rename money_check to money_check.py --- 1_beginner/chapter4/practice/{money_check => money_check.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename 1_beginner/chapter4/practice/{money_check => money_check.py} (100%) diff --git a/1_beginner/chapter4/practice/money_check b/1_beginner/chapter4/practice/money_check.py similarity index 100% rename from 1_beginner/chapter4/practice/money_check rename to 1_beginner/chapter4/practice/money_check.py From d0278eb05025c1e54f43f35f4dbb61dffbe626bb Mon Sep 17 00:00:00 2001 From: Rebecca Dang Date: Tue, 7 Jul 2020 16:01:25 -0700 Subject: [PATCH 4/5] Shorten line length --- 1_beginner/chapter4/practice/money_check.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/1_beginner/chapter4/practice/money_check.py b/1_beginner/chapter4/practice/money_check.py index b85f88df..4a17169b 100644 --- a/1_beginner/chapter4/practice/money_check.py +++ b/1_beginner/chapter4/practice/money_check.py @@ -1,5 +1,9 @@ # Money Check -# Write a program that asks for a person's amount of money(floating point). -# If the person's amount of money is 0, print "Bankrupt". If not, print "Not Bankrupt" -# If the person's amount of money is greater than 1000.0, then print "Rich" +# Write a program that asks for a person's +# amount of money (floating point). +# If the person's amount of money is 0, +# print "Bankrupt". If not, print "Not Bankrupt" +# If the person's amount of money is +# greater than 1000.0, then print "Rich". + # Write your code here From 440e6f31ae896b7ee57422cbc805a5a9ad949f5a Mon Sep 17 00:00:00 2001 From: Rebecca Dang Date: Tue, 7 Jul 2020 16:04:46 -0700 Subject: [PATCH 5/5] Add Money Check solution code --- 1_beginner/chapter4/solutions/money_check.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 1_beginner/chapter4/solutions/money_check.py diff --git a/1_beginner/chapter4/solutions/money_check.py b/1_beginner/chapter4/solutions/money_check.py new file mode 100644 index 00000000..548bd2a7 --- /dev/null +++ b/1_beginner/chapter4/solutions/money_check.py @@ -0,0 +1,17 @@ +# Money Check +# Write a program that asks for a person's +# amount of money (floating point). +# If the person's amount of money is 0, +# print "Bankrupt". If not, print "Not Bankrupt" +# If the person's amount of money is +# greater than 1000.0, then print "Rich". + +money = float(input("Enter the amount of money you have: $")) + +if money == 0: + print("Bankrupt") +else: + print("Not Bankrupt") + +if money > 1000: + print("Rich")