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

Python Programming Assignments Guide

The document outlines a comprehensive list of Python programming assignments designed for students, covering basic to advanced concepts. It includes tasks such as arithmetic operations, series calculations, pattern printing, string manipulations, and data structures like lists, tuples, sets, and dictionaries. Each assignment aims to enhance the understanding and application of Python programming skills.
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)
8 views5 pages

Python Programming Assignments Guide

The document outlines a comprehensive list of Python programming assignments designed for students, covering basic to advanced concepts. It includes tasks such as arithmetic operations, series calculations, pattern printing, string manipulations, and data structures like lists, tuples, sets, and dictionaries. Each assignment aims to enhance the understanding and application of Python programming skills.
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

Python Assignments:-
1. Hello world program.
2. Addition of two numbers.
3. Find the Square and Square root of a given number.
4. Area and perimeter of a rectangle
5. Area of a Triangle.
6. Python Program to Convert Celsius to Fahrenheit and vice versa.
7. Convert Kilometre to Mile. Where 5 Mile = 8 Kms. Or Conversion factor 0.621371
8. Convert Mile to KM.
9. Calculate Amount using simple interest formula A = P(1+RT) where P = Principal, R = Rate of
Interest, and T = Time period are unknown. Here, the rate is given in percentage (r%) is written as
r/100
10. Calculate Amount using compound interest formula A = P(1+R/N) NT where P, R, N and T are
unknown. [For an initial principal of P, rate of interest per annum of R, time period T in years,
frequency of the number of times the interest is compounded annually N]
11. Check whether a given number is Even or Odd: -
12. Check if a number is positive, negative or zero.
13. Find Max Min of two numbers.
14. Find the largest among 3 numbers.
15. Check if a given year is leap year or not.
16. Print the series 1 2 3 4 5 …. N.
17. Print the odd series: 1 3 5 7 …. N.
18. Print the Sum of the series: S = 1 + 2 + 3 + … + N
19. Print the Sum of the series: S = 2 + 4 + 6 + … + N
20. Find the factorial of N. [N! = 1*2*3*… *(N-1) *N]
21. Find the Sum of the series: S= x + x2+x3+ …. xn, where the value of x and n are unknown.
22. Find the Sum of the series: S= x + (x2/2) + (x3/3) + …. xn/n, where the value of x and n are unknown.
23. Find the Sum of the series: S= -x + x2- x3+ …. xn, where the value of x and n are unknown.
24. Find the Sum of the series: S= x + (x2/2!) + (x3/3!) + …. xn/n! where the value of x and n are
unknown.
25. Find the Sum of the series: S= -x + (x2/2!) - (x3/3!) + …. xn/n!, where the value of x and n are
unknown.
26. Print the Fibonacci Series: - 0 1 1 2 3 5 8 13 21 …. n
27. Print the sum of the Fibonacci Series.
28. Find whether a number is prime or unprime.
29. Find the HCF and LCM of two numbers.
30. Find the sum of the digits of a number.
31. Check if the product of the digits of a number is equals to the number or not.
32. Reverse a number.
33. Python Program to Find the Factors of a Number.
34. Print from 10 to 1 using for loop: -
35. Check whether a number is Armstrong number of order three or not? [ 153 = 1 3 + 53 + 33 is an
Armstrong number of order three]

Sambuddha Das, Assistant Professor (WBES), Department of Computer Science, Chandernagore College
2

36. Check whether a number is Armstrong number of order n or not.


37. Check whether a number is a perfect number or not. [Any number can be perfect number, if the
sum of its positive divisors excluding the number itself is equal to that number. For example, 6 is a
perfect number in because 6 is divisible by 1, 2, 3 and 6. So, the sum of these values is: 1+2+3 = 6
(Remember, we have to exclude the number itself].

Print the patterns: -


38. Write a program to print Increasing Triangle using *

*
* *
* * *
* * * *
* * * * *
39. Write a program to print a Decreasing Triangle using *

* * * * *
* * * *
* * *
* *
*
40. Write a program to print a Right Sided Triangle using *

*
* *
* * *
* * * *
* * * * *

41. Write a program to print a Hill Pattern Triangle using *

*
***
*****
*******
*********
42. Write a program to print a reverse Hill Pattern using ‘*’.

* * * * * * * * *
* * * * * * *
* * * * *
* * *
*

Sambuddha Das, Assistant Professor (WBES), Department of Computer Science, Chandernagore College
3

43. Write a program to print a Diamond Pattern using ‘*’.

*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * *
* * * * *
* * *
*

44. Program to print half pyramid a using numbers

1
12
123
1234
12345

45. Pattern Printing - Decreasing Triangle with Numbers


12345
1234
123
12
1

46. Floyd's Triangle


1
23
456
7 8 9 10

47. Program to print half pyramid using alphabets


A
BB
CCC
DDDD
E EE E E

Sambuddha Das, Assistant Professor (WBES), Department of Computer Science, Chandernagore College
4

48. Program to print half pyramid using alphabets


A
BC
DEF
GHIJ
KLMNO

49. Program to print half pyramid using alphabets


A
AB
ABC
ABCD
ABCDE

50. Write a program to print a Hill Pattern Triangle using Alphabets

A
A B C
A B C D E
A B C D E F G
A B C D E F G H I
51. Write a program to print a Hill Pattern Triangle using Alphabets

A
A B A
A B C B A
A B C D C B A
A B C D E D C B A

Strings
52. Input a string and count the length of the string.
53. Convert a string to Upper, Lower, Title and swap case with python methods.
54. How to find the ASCII/Unicode value of a given character and the character from a given ASCII/Unicode
value.
55. Concatenate two strings.
56. Convert a string from Upper to Lower case without using python methods.
57. Count the number of occurrences of a string from a supplied paragraph.
58. Split a string whenever an “&” occurs in a string.
59. Check whether two strings are identical or not.
60. Check whether a string Palindrome or not. [Palindrome = MADAM / Madam]
61. Check if two strings Anagram or not. [Anagram = Race/ Care]

Sambuddha Das, Assistant Professor (WBES), Department of Computer Science, Chandernagore College
5

Lists, tuple, set, Dictionary: -


62. Create a list with 10 integers. Show the original list and the list in reverse order. (Use reverse () function): -
63. Check whether a list is empty or not.
64. Create a dynamic size list using append (). Use insert () to insert at the 1st and 4th location. Show the length of
the list. Use slicing to show the first and the second half of the list separately.
65. Create a list of integers. Delete the even elements.
66. Find the sum and average of a list of integers. Where the list size is 6.
67. Search a given key value from a list of 10 integers.
68. Show the even numbers from a given list of 6 integers.
69. Sort a list using bubble sort technique: -
70. Sort a list using insertion sort technique: -
71. Create a tuple with 5 elements. Add 2 more elements. Delete the 3rd element.
72. Unpack a tuple.
73. Create a set with 5 elements. Search the set for a particular key. Join two sets.
74. Create a dictionary. Print its elements. Insert a key value pair in the existing dictionary.

Sambuddha Das, Assistant Professor (WBES), Department of Computer Science, Chandernagore College

You might also like