Question-76: Input to a function is always a String. And you should not directly use it in calculation?
- True
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering Python Certification Material
Answer :
Exp:
input() function
- As we discussed, print() function does not return any value.
- It just print the calculated expression value as string on console.
- Based on function name, you would like to guess what it can do.
- It reads the value provided and in program we can use it.
- This makes your program more interactive.
- Now, you can say this can take input from voice, file, images etc.
- You have to store, input in a variable. If you want to use it further in your program.
Taking input
print("What is the name of this learning platform") myInput = input() print("This is \"", myInput, " \" Provides various stuff") |
If you want to use your input only once. Then no variable needed.
You can access to full explanation to question and answer from this page.