Python Basic Input and Output


1) Simple Greeting

Ask the user for their name and print:

Hello, <name>!

2) Favorite Color

Ask the user:

What is your favorite color?

Print:

Your favorite color is <color>.

3) Add Two Numbers

Prompt the user for two numbers, add them, and print the result.


4) Echo Input

Ask the user to enter any text, then print exactly what they entered.


5) Personalized Message

Ask for the user’s name and age, then print:


6) Calculating Next Year Age

Ask the user for their age, then print:

(Convert the input to the correct type.)


7) Area of a Rectangle

Ask for:

Calculate and print:


8) Full Name Input

Ask separate inputs for first name and last name. Print:


9) Favorite Food

Ask:

Print:


10) Convert and Multiply

Ask user for a number, convert it to integer, multiply by 10, and print.


11) Temperature Convert (°C to °F)

Ask user for temperature in Celsius. Convert to Fahrenheit using:

Print the result.


12) Greeting with Age Check

Ask for name and age. Print:

If age < 18:


13) Sum of Three Numbers

Prompt for 3 numbers and print the total.


14) Favorite Movie

Ask for favorite movie title and print:


15) Repeat Text

Ask user for text and number n. Print the text n times.


16) Greet with Uppercase

Ask for name and print it in uppercase:


17) Personalized Sentence

Ask for city and hobby. Print:


18) Input Float and Print Rounded

Ask for a decimal number. Convert to float and print rounded value using round().


19) Check Even or Odd

Ask for a number. Print whether it is even or odd.


20) Ask for Three Words and Print

Prompt:

Print each word on a new line.


📝 Example Output Patterns

Here’s what one of the programs might output:


canvil: 333f6c7d-6876-4f7e-b6ad-1bdb2233f5c1

Last updated