user input - Introduction to Python: Absolute Beginner Module 1 Video 15

Veröffentlicht am: 24 Juli 2021
auf dem Kanal: Book Simplifiers
39
3

Concept: user input
input()
get information from users with input()
the input() function prompts the user to supply data returning that data as a string
Example
review and run code - enter a small integer in the text box
print("enter a small int: ")
small_int = input()
print("small int: ")
print(small_int)
Task 1
storing input in a variable
[ ] create code to store input in student_name variable
an input box should when run
[ ] type a name in the input box and press Enter
[ ] determine the type() of student_name
[ ] get input for the variable student_name

[ ] determine the type of student_name



Task 1 continued...
note: input() returns a string (type = str) regardless of entry

if a string is entered input() returns a string
if a number is entered input() returns a string

[ ] determine the type() of input below by entering

a name
an integer (whole number no decimal)
a float a number with a decimal point
[ ] run cell several times entering a name a int number and a float number after adding code below
print("enter a name or number")
test_input = input()
[ ] insert code below to check the type of test_input


Auf dieser Seite können Sie das Online-Video user input - Introduction to Python: Absolute Beginner Module 1 Video 15 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Book Simplifiers 24 Juli 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 39 Mal angesehen und es wurde von 3 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!