Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Python Assignment

The document outlines a series of programming assignments that involve basic Python tasks such as calculating averages, checking for Armstrong numbers, summing digits, reversing numbers, printing patterns, and manipulating lists and dictionaries. It also includes tasks for generating Fibonacci sequences, handling email addresses, storing sparse matrices, and implementing encryption algorithms like Caesar cipher and RSA. Each assignment is designed to enhance programming skills and understanding of data structures in Python.

Uploaded by

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

Python Assignment

The document outlines a series of programming assignments that involve basic Python tasks such as calculating averages, checking for Armstrong numbers, summing digits, reversing numbers, printing patterns, and manipulating lists and dictionaries. It also includes tasks for generating Fibonacci sequences, handling email addresses, storing sparse matrices, and implementing encryption algorithms like Caesar cipher and RSA. Each assignment is designed to enhance programming skills and understanding of data structures in Python.

Uploaded by

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

Assignment 1

1. Write a program to read the numbers until -1 is encountered. Find the avaearge of positive
numbers and negative numbers entered by user.
2. WAP to find the given number is an Armstrong number or not.
3. WAP to enter a number and then calculate the sum of digits.
4. WAP to find reverse of a number.
5. WAP to print following patterns

a)
1
22
333
4444
55555

b)
1
121
12321
1234321

6. WAP to print the Calendar of any given year.


Hint: import calendar and use its functions.
MODULE REFERENCE
https://docs.python.org/3.8/library/calendar

7. WAP to create a list of numbers in the range 1 to 10. Then delete all the even numbers from
the list and print the final list.
8. Write a program to remove all duplicates from a list.
9. WAP to generate fibonacci sequence and store in a list. Then find the sum of the even-valued
terms.
10. WAP that scans an email address and forms a tuple of user name and domain.
11. WAP to store a sparse matrix as a dictionary
Output: {(0,3):8, (2,3): 5, (1,0):3, (1,4): 1}
Sparse Matrix
00080
30001
00050
12. WAP that has a dictionary of names of students and a list of their marks in 4 subjects.
Create another dictionary from this dictionary that has a name of the students with their total
marks. Find the student that have scored highest marks with his/her marks.
13. WAP that combines the lists to a dictionary.
14. WAP to encrpt and decrypt message using caesar cipher
encryption function, e(x) = (x+key)% 26
decryption function, e(x) = (x-key)% 26

15. WAP to implement RSA Algorithm

You might also like