menu search
brightness_auto
more_vert
2 1

Explain python input and output with the help of an example

Topic Python Programming
Type Short Answer Type
Class 10
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike

1 Answer

more_vert
 
verified
Verified Answer
1

How to take User Input in Python

Sometimes it happens that the programmer or the developer might want to take user input in the Program.

For Example: While making a program that can add two numbers, you need the user input for the 2 numbers. 

Python Provides the input() function for this task, Which can be written as.

input("Some text to show")

Here, instead of "Some text to show" you can write any text you want to show the user before the Input Area.

How to Display Output in Python

Python provides the print() function to display output when used, for Example:
print("Hello World")
output: Hello World
thumb_up_off_alt 1 like thumb_down_off_alt 0 dislike

Related questions

thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 3 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 1 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 1 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
thumb_up_off_alt 2 like thumb_down_off_alt 0 dislike
1 answer
...