0% found this document useful (0 votes)
2 views1 page

Python Programming Exercises for Beginners

The document contains a series of Python programming exercises, including printing a formatted string, reversing user input, converting mathematical formulas into Python code, and performing basic arithmetic operations. It also includes tasks for calculating the area of a triangle, the volume of a sphere, and the area and perimeter of a circle. Additionally, it covers variable swapping techniques in Python.

Uploaded by

Nadoush Ben
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Programming Exercises for Beginners

The document contains a series of Python programming exercises, including printing a formatted string, reversing user input, converting mathematical formulas into Python code, and performing basic arithmetic operations. It also includes tasks for calculating the area of a triangle, the volume of a sphere, and the area and perimeter of a circle. Additionally, it covers variable swapping techniques in Python.

Uploaded by

Nadoush Ben
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Sheet (1)

Python programming
1. Write a Python program to print "30+20=50". Given variables x=30 and y=20.
2. Write a Python program which accepts the user's first and last name and print them in reverse order with a space
between them.

3. Convert the following formulas into Python code statements:

a. 𝑌 = 𝑥 3 + 3𝑥 2 + 3𝑥 + 1

b.𝑦 = √𝑥 + 1*√𝑥 + 2*√𝑥 + 3

4. Write a Python code to do the following:-

a. To add two numbers.

b. To subtract two numbers.

c. To multiply two numbers. d. To divide two numbers.

5. Write a program to calculate the area of a triangle.

6. Write a Python program to get the volume of a sphere with radius 6.

7. Write a Python code that accepts the radius of a circle and prints its area and perimeter.

a. Area = Pi* r2

b. Perimeter = 2*Pi*r

8. Write a Python program to swap two variables by using a temporary variable and, without using temporary variable.

You might also like