Dec-07-2016, 10:25 PM
.isdigit() converts whatever you type into a bool True/False. So if you type 2, what will always be True. When adding a bool to a number, it's silently converted to "1", which is why you're seeing 1.0.
Instead of
Instead of
what = raw_input("???").isdigit()
, try:what = raw_input("???") if what.isdigit(): if what == "1": bal = float(raw_input("new balance: ")) elif what == "2": # etc...