0% found this document useful (0 votes)
22 views2 pages

Python Programming Exercises for Beginners

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)
22 views2 pages

Python Programming Exercises for Beginners

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

1.

Accept 10 integers from user and print their average value on the screen
2. Print the following patterns using loop :
a.
*
**
***
****
b.
*
***
*****
***
*
c.
1010101
10101
101
1
d.
1
12
123
1234
12345

3. Write a program to find greatest common divisor (GCD) or highest common factor (HCF) of
given two numbers.
4. Take integer inputs from user until he/she presses q ( Ask to press q to quit after every
integer input ). Print average and product of all numbers.
5. Given a number count the total number of digits in a number and also find sum of digits of
the number.
6. To display the cube of the number upto given an integer. If the given integer is 5, then
display cube of 1 to 4.
7. Accept 20 numbers from user and display sum of only even numbers.
8. Ask user number of terms to be generated of a series.
generate numbers for the following series and find its addition
[9 + 99 + 999 + 9999+……..]
9. Write a program in python to display the sum of the series [ 1+x+x^2/2!+x^3/3!+....]. Go to
the editor

Test Data :

Input the value of x :3

Input number of terms : 5

Expected Output :

The sum is : 16.375000


10. Write a program in python to find the sum of the series [ x - x^3 + x^5 + ......]. Go to the editor

Test Data :

Input the value of x :2

Input number of terms : 5

Expected Output :

The values of the series:

-8

32

-128

512

The sum = 410

You might also like