Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions 1_beginner/chapter4/practice/money_check.py
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions 1_beginner/chapter4/solutions/money_check.py
Original file line number Diff line number Diff line change
@@ -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")