0% found this document useful (0 votes)
24 views5 pages

Py Excercise

This document contains a list of 64 programming tasks ranging from basic math and logic problems to more advanced concepts involving data structures like lists, tuples, sets and functions. The tasks include calculating sums and averages, searching and sorting lists, manipulating tuples and sets, drawing shapes with Turtle graphics, checking data types, and printing patterns and tables. The list covers a wide breadth of introductory Python programming concepts.

Uploaded by

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

Py Excercise

This document contains a list of 64 programming tasks ranging from basic math and logic problems to more advanced concepts involving data structures like lists, tuples, sets and functions. The tasks include calculating sums and averages, searching and sorting lists, manipulating tuples and sets, drawing shapes with Turtle graphics, checking data types, and printing patterns and tables. The list covers a wide breadth of introductory Python programming concepts.

Uploaded by

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

1.

Wap to find sum of two nos


2. Wap to swap value of two variable using a temp variable
3. Wap to take name and age of any student and print them
4. Wap to check given no is even or odd
5. Python program to convert the temperature in degree centigrade to Fahrenheit
6. Python program to find the circumference and area of a circle with a given radius
7. Python program to implement a calculator to do basic operations
8. Check whether a character is an alphabet, digit or special character.
9. Program to check whether a person is eligible to vote or not.
10.

11.
12.

Calculate the sum of all numbers from 1 to a given number


13. Display following

14.
111111111
222222222
333333333
444444444
555555555
666666666
777777777
888888888
999999999

15.
1
12
123
1234
12345

16.
1
22
333
4444
55555
17. Print a downward Half-Pyramid Pattern of Star (asterisk)
*****
****
***
**
*
18. Wap to print no from 1 to 10
19. Wap to print table of any no
20. Wap to print sum of any five no
21. Wap to print multiplication of any seven no
22. Wap to print reverse of any no
23. Wap to check no is Armstrong or not
24. Wap to check no is palindrome or not
25. Python program to display all the multiples of 3 within the range 10 to 50
Function program
26. Python program to find the factorial of a number using recursion

list Programs

27. Write a program to display only those numbers from a list that satisfy the following
conditions
 The number must be divisible by five
 If the number is greater than 150, then skip it and move to the next number
 If the number is greater than 500, then stop the loop
numbers = [12, 75, 150, 180, 145, 525, 50]
output ----75
150
145
28. Wap to print list in loop
29. Find sum and average of list in python
30. Python program to implement linear search
31. Python program to implement binary search
32. Python program to find the largest number in a list without using built-in functions
33. Python program to insert a number to any position in a list
34. Python program to delete an element from a list by index
35. Display numbers divisible by 5 from a list
36. Wap to find even and odd numbers in a list
37. Python program to interchange first and last elements in a list
38. Python program to swap two elements in a list
39. Python | Ways to check if element exists in list
40. How to count unique values inside a list
41. Write a program to count the number of items stored in a list.
42. Python program to square each element of a list.
43. Python program to remove an empty element from a list.
44. Write a program to sum all the elements of a list.
Tuple Programs
45. Python program to Find the size of a Tuple
46. Python – Maximum and Minimum K elements in Tuple
47. Python – Sum of tuple elements
48. Swapping first and last element in tuple
49. Adding Tuple to List and vice – versa
50. Reverse the tuple
51. tuple1 = (10, 20, 30, 40, 50)
52. tuple1 = tuple1[::-1]
53. print(tuple1)
set Programs
54. Find the size of a Set in Python
55. Python – Maximum and Minimum in a Set
56. Python – Remove items from Set
57. Python program to count number of vowels and consonant using sets in given string
58. Union
59. Intersection
60. Difference
61. Symmetric difference
set Programs
62.
63. Check Python version
import sys # Import the sys module to access system-specific parameters and functions
# Print the Python version to the console
print("Python version")
# Use the sys.version attribute to get the Python version and print it
print(sys.version)
# Print information about the Python version
print("Version_info.")
# Use the sys.version_info attribute to get detailed version information and print it
print(sys.version_info)
Python: Print current time and date
64. program to draw a circle of squares using Turtle
import turtle
x=turtle.Turtle()
def square(angle):
x.forward(100)
x.right(angle)
x.forward(100)
x.right(angle)
x.forward(100)
x.right(angle)
x.forward(100)
x.right(angle+10)
for i in range(36):
square(90)
Output:

You might also like