Default values on empty user input
问题 Here I have to set the default value if the user will enter the value from the keyboard. Here is the code that user can enter value: input = int(raw_input("Enter the inputs : ")) Here the value will be assigned to a variable input after entering the value and hitting Enter . Is there any method that if we don't enter the value and directly hit the Enter key, the variable will be directly assigned to a default value, say as input = 0.025 ? 回答1: input = int(raw_input("Enter the inputs : ") or