This video covers how to read in information from user input and store it to a variable. Then we use that variable to display the user input on the screen. Also, it covers type casting where we convert a string variable into an integer variable. Finally, we learn how to create a new Python script. Demonstrated on Mac OS X.
Please comment, rate, and subscribe ;)
Links:
http://www.python.org/download - Download Python
Code:
#store the user input to a variable called 'name'
#raw_input returns a string
name = raw_input("What is your name? ")
#store the user input to a variable called number
#int converts the string to an integer
number = int(raw_input("How many apples were picked today? "))
#display 'Hello blank!" where the user input replaces the blank
print "Hello %s!" %name
En esta página del sitio puede ver el video en línea Python Tutorial 5: Raw_Input (User Input) de Duración hora minuto segunda en buena calidad , que subió el usuario JAA228 22 noviembre 2011, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 36,214 veces y le gustó 119 a los espectadores. Disfruta viendo!