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

Publicado el: 24 julio 2021
en el canal de: 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


En esta página del sitio puede ver el video en línea user input - Introduction to Python: Absolute Beginner Module 1 Video 15 de Duración hora minuto segunda en buena calidad , que subió el usuario Book Simplifiers 24 julio 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 39 veces y le gustó 3 a los espectadores. Disfruta viendo!