Question: Hi , Why do we need an input function instead of writing it as a str ? Thanks! An interactive program You can instruct Python

Hi,
Why do we need an input function instead of writing it as a str?
Thanks!
An interactive program
You can instruct Python to pause and read data from the user using the input() function:
input(prompt)
The input() function returns a string
name = input('Who are you?')
print(f'Welcome to the class,{name}!')
*
Hi , Why do we need an input function instead of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!