Python Tutorial 5: Raw_Input (User Input)

Veröffentlicht am: 22 November 2011
auf dem Kanal: JAA228
36,214
119

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


Auf dieser Seite können Sie das Online-Video Python Tutorial 5: Raw_Input (User Input) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer JAA228 22 November 2011 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 36,214 Mal angesehen und es wurde von 119 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!