diff --git a/1_beginner/chapter4/practice/money_check.py b/1_beginner/chapter4/practice/money_check.py new file mode 100644 index 00000000..4a17169b --- /dev/null +++ b/1_beginner/chapter4/practice/money_check.py @@ -0,0 +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 your code here 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")