0% found this document useful (0 votes)
2 views30 pages

Programs 1

The document contains a list of programming tasks that involve various coding challenges in Python, including string manipulation, file handling, and data processing. Each task requires the implementation of functions to perform specific operations, such as identifying Armstrong numbers, calculating statistics from data files, and managing flight details. The tasks are structured to enhance programming skills and understanding of data structures and algorithms.

Uploaded by

janya02.gdgps
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)
2 views30 pages

Programs 1

The document contains a list of programming tasks that involve various coding challenges in Python, including string manipulation, file handling, and data processing. Each task requires the implementation of functions to perform specific operations, such as identifying Armstrong numbers, calculating statistics from data files, and managing flight details. The tasks are structured to enhance programming skills and understanding of data structures and algorithms.

Uploaded by

janya02.gdgps
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

INDEX

[Link]. Program Teacher’s


signature
1. Write a code to get a string from a given string where all
occurrences of its first character have been changed to '*',
except the first character itself using function.
2. Write a code to swap commas and dots in a user defined
string using function.
3. Write a code to find all duplicate characters in a user
defined string using function.
4. Write a code LeftShift(lst, x) in Python which accepts
numbers in a list (lst) and all the elements of the list should
be shifted to left according to the value of x.
5. Write a code using function to identify whether a given
number is Armstrong number or not.
6. Write a program using function and container function that
groups anagrams together using dictionaries:
words = ['eat', 'tea', 'tan', 'ate', 'nat', 'bat']
# Output: {'aet': ['eat', 'tea', 'ate'], 'ant': ['tan', 'nat'], 'abt':
['bat']}
7. Write a code to generate a random numbers between 1 and
6 which simulates just like a dice
8. Write a code to determine whether the given string is
palindrome or not using function.
9. Write a code to determine the mean,median and mode of
all the elements of a list using functions.
10. Write a code to read data from a text file [Link], and
display word which have maximum/minimum characters.
11. Write a code to read data from a text file [Link], and
display each words with number of vowels and consonants.
12. Write a code to read data from a text file [Link], and
convert all uppercase characters to lowercase and vice
versa.
13. Write a code which accepts author name as parameter and
count and return number of books by the given author are
stored in the binary file “[Link]”
14. Write a code to display the record of a particular product
from [Link] whose code is passed as an argument. The file
contains product code and price.
15. Write a code considering a binary file ‘[Link]’ having
structure [admnno, Name, Percentage]. Create a function
that would read all content of file and display the details of
those students whose percentage is above 90. Also display
the number of students scoring above 90% and above 80%
separately.
16. Write a program to read all content of “[Link]” and
display records of only those books whose author is given
by user. Records stored in students is in format: Book id,
book name, author, edition, price
17. Write a program to calculate the percentage of all the
students given in the file” [Link]”. Records in marks .csv
should be in the following format
Rollno, Name, marks
18. Write a program to calculate the sum of all the marks given
in the file “[Link]”. Records in marks .csv should be in
the following format
#Rollno, Name, marks
#Create a separate function to show the detail of the
student who scored the highest marks , lowest marks
19. Write a menu driven code using functions Addflight(),
Delete flight(), Display flight() to implement the Stack. The
program will store the details of the flights i.e. flight
number, flight name and fare.
20. Write a code to display the size of a text file in bytes.
21. Write a program having add and remove functions to add
new client and delete existing client from a list "client
detail" displaying push and pop operations on the stack.
Also search a specific client using his/her id. The client detail
list should include id, client name and contact no.
22. Write command to calculate the max, min, average, sum of
marks from student table having columns as rollno, name,
class, marks, city.
23. Write a code to insert a new record in table student. The
function should pass values as parameters. (refer table of
Q22)
24. Write a code to delete a record in the student table
according to the rollno passed as parameter. (refer table of
Q22)
25. Write a code to read the student marks as parameter and
update the record in student table. (refer table of Q22)
26. MY SQL QUERIES
Program-1
Program-2
Program-3
Program-4
Program-5
Program-6
Program-7
Program-8
Program-9
Program-10
Program-11
Program-12
Program-13
Program-14
Program-15
Program-16
Program-17
Program-18
Program-19
Program-20
Program-21
Program-22
Program-23

You might also like