How to set a "null" to 0


I’m trying to create a money calculator, but if someone dont put a number in the raw_input the addition dont work, i want to set “null” to zero

How i do this?


What is null in that context?
If it’s input, then your program doesn’t set the input
If you mean to set a variable to zero when you get “null” as input, that’s something you’d use an if-statement for


The null is when the raw_input ask:

How many (a money value)? and the user dont put a number, just pressing enter


Only way I can read that is that you want:

null = 0


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.