[go: up one dir, main page]

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

Python Programs Exercise

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

Python Programs Exercise

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

1.

Write a Python program to print the following:


"Twinkle Twinkle Little Star,
How I wonder what you are,
Up above the world so high,
Like a diamond in the sky."

2. Write a Python program which accepts the radius of a circle from the user and
find its area.

3. Write a python program that accepts a sequence of comma separated value from the
users and generate list and tuple with those numbers.

4.Write a Python program to display the first and last color of the list.

5. Write a program to get the difference between a given number and 24, if the
number is greater than 24, then return the absolute difference.

6. Write a Python program to test whether a number is within 100 or 1000 or 10000

7. Write a Python program to calculate the sum of three numbers and if the values
are equal, then return three times of their sum.

8. Write a python program to get a new string from a given string where "Is" has
been added to the front. If the given string aleady begins with "Is", then return
the string unchanged.

9. Write a Python program to count the number of 2 in a given list.

10. Write a python program to test whether the passed letter is a vowel or not.

11. Write a Python program to display your details like Name,age, address, city,
country, each in a separate line.

12. Write a Python program to calculate the length of a string.

13. Write a Python program to convert height (in feet) to centimeters, (in inches)
to centimeters.
Note: cm=feet*30.48, cm=inch*2.54

14. Write a Python program to convert the distance(in feet) to inches, yards and
miles.
Note: inch=feet*12, yard=feet/3, miles=feet/5280

15. Write a Python program to convert seconds to day, hour, minutes and seconds.

16. Write a Python program to display numbers from a list divisible by 5

17. Write a Python program to display the Current date and time.

18. Write a Python program to return True if the list’s first and last numbers are
the same. If the numbers are different, return False.

19. Write a Python program to count the total number of digits in a number using a
while loop.

20.Write a Python program to print the cube of all numbers from 1 to a given number

You might also like