python 3.x - How do I input an integer on a new line -
i trying make input integer on new line using python, error when this.
#inputs mymath integer print = ("give me number , double you.") mymath = int(input + "\n") #multiplies mymath(the variable) times 2 result = eval("2 * mymath")
the error says "typeerror: unsupported operand type(s) +: 'builtin_function_or_method' , 'str'" using python 3.5.1.
here want:
yourval = int(input("double number:\n")) result = yourval*2 print(result)
Comments
Post a Comment