Skip to content

Final-PythonFoundationHomework/simple_input_homework

Repository files navigation

Simple Python Homework: Input, Variables, and Arithmetic Operators

Complete the following 10 tasks using Python. Each task requires using the input() function and variables, and performing basic arithmetic operations.


1. Add Two Numbers

Task: Ask the user to enter two numbers and print their sum.

Example:

Input:
5
7
Output:
12

2. Area of a Rectangle

Task: Ask the user to enter the width and height of a rectangle and print its area.

Example:

Input:
4
6
Output:
24

3. Difference of Two Numbers

Task: Ask the user to enter two numbers and print the difference (first minus second).

Example:

Input:
15
8
Output:
7

4. Calculate the Average

Task: Ask the user to enter three numbers and print their average.

Example:

Input:
10
15
25
Output:
16.666666666666668

5. Celsius to Fahrenheit

Task: Ask the user to enter a temperature in Celsius and print it in Fahrenheit. (F = C × 1.8 + 32)

Example:

Input:
0
Output:
32.0

6. Square of a Number

Task: Ask the user to enter a number and print its square.

Example:

Input:
9
Output:
81

7. Remainder of Division

Task: Ask the user to enter two numbers and print the remainder when the first is divided by the second.

Example:

Input:
20
6
Output:
2

8. Double the Input

Task: Ask the user to enter a number and print twice its value.

Example:

Input:
13
Output:
26

9. Perimeter of a Square

Task: Ask the user to enter the length of a square's side and print its perimeter.

Example:

Input:
5
Output:
20

10. Multiply Three Numbers

Task: Ask the user to enter three numbers and print their product.

Example:

Input:
2
3
4
Output:
24

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages