get input from user in python

Solutions on MaxInterview for get input from user in python by the best coders in the world

showing results for - "get input from user in python"
Rafaela
26 Nov 2020
1# Python 2
2
3txt = raw_input("Type something to test this out: ")
4print "Is this what you just said?", txt
5
Ela
21 Jan 2016
1# Python 3
2
3txt = input("Type something to test this out: ")
4
5# Note that in version 3, the print() function
6# requires the use of parenthesis.
7print("Is this what you just said? ", txt)
8
Antonio
05 Jul 2018
1string = input("Enter a string: ")
2number = int(input("Enter a number: "))