0% found this document useful (0 votes)
14 views

Python Practice Questions 1

Python questions

Uploaded by

Surya Bharadwaj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Python Practice Questions 1

Python questions

Uploaded by

Surya Bharadwaj
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Python Programming questions for practice

1. Write a python program to input a number and find the square and display the square.
2. Write a python program to input two numbers and find the sum of two numbers and display
the sum.
3. Write a python program to find largest of three numbers using simple if statement.
4. Write a python program to check whether the entered year is leap year.
5. Write a python program to find sum of digits of a number using while loop.
6. Write a program to check a number is palindrome or not using while loop.
7. Write a program to check a number is Armstrong number or not using while loop.
8. Write a program to find the factorial of a number using for loop.
9. Write a program to display all the elements of a list using a loop.
10. Write a program to display all the elements of a list using index.
11. Write a program to print elements of a list are even number or odd number.
12. Write a program to print elements of a list are palindrome or not.
13. Write a program to find sum of all the elements of a list.
14. Write a program to reverse a list using range() function.
15. Write a program to reverse a list using slicing method.

----------------------------------------------------------------------------------------------------------------

Consider a list, List1=[12,23,45,67,89,90,91,92,93,94,95,96,97,99]

16. Use slicing method to print elements from 12 to 92.


17. Use slicing method as and -ve indexing to print elements from 12 to 92.
18. Write a program to print the output as [12,45,89,91]
19. Write a program to print the output as [91,89,45,12]
20. Write a program to print the output as [12,99]

---------------------------------------------------------------------------------------------------------------

21. Write a python program to print count of Armstrong numbers present in the list.
22. Write a python program to print the numbers ends with digit 8 in a list.
23. Write a python program to print sum of numbers divisible by 3 in a list.
24. Write a python program to find sum of each second number in the list.
25. Write a python program to generate Fibonacci series up to a limit.

You might also like