2

My submissions used the pattern def main(): #main function pass def my_helper(): #whatever else I'm doing pass if __name__ == "__main__": #actually run the stuff, all functions are available main() and passed the tests. Though I never tried with -m, they work in both ways. I don't think -m makes much of a difference when you have ...


2

If you were to print(warehouse) after this line warehouse = ((c_number / 10)%10)*2 you'd discover that it returns a floating point number. Python doesn't do integer division like C unless you use the // operator (integer division operator).


1

Python 3 no longer has the / division operator work differently for integers and floating point numbers. Instead, / now is floating-point division, while the new operator // is the integer division, truncating the result. So use //= instead of /=.


1

This might do the trick. Otherwise send the entire code so I can test it out. Below will certainly be needed to make any code work, I hope it solves your particular problem. if name == "34" or if name == "37": print("AMEX") elif name == "51" or name == "52" or name == "53" or name == "54" or name == "55": print("MasterCard")


1

The output shown makes no sense to me, but int will throw an error if the value is not the representation of an integer. You can for example use it like while True: user_input = input("Height: ") # isdigit returns True only if all characters are digits, AKA non-negative integer if user_input.isdigit(): h = int(user_input) if 0 &...


Only top voted, non community-wiki answers of a minimum length are eligible