Python Programming - Console Input/Output - Discussion

Discussion Forum : Console Input/Output - General Questions (Q.No. 29)
29.
How can you prompt the user for input and convert it to an integer in a single line?
input().convert_to_int()
int(prompt("Enter an integer: "))
user_input = input("Enter an integer: "); int(user_input)
int(input("Enter an integer: "))
Answer: Option
Explanation:
To prompt the user for input and convert it to an integer in a single line, use int(input("Enter an integer: ")).
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.