Skip to content

Dhinakaran-Thiru/Python_Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 

Repository files navigation

question 1 *Read the number of student records (n) from the input. *Create an empty dictionary to store student records. *For each of the n student records, parse the name and marks, and store them in the dictionary. *Read the query name (query_name) from the input. *Retrieve the marks corresponding to query_name from the dictionary. *Calculate the average of the marks. *Print the average with two decimal places. question 2 *Read the integer n from the input, representing the number of participants. *Read the list of integers scores from the input. *Convert the input string of scores into a list of integers. *Remove duplicates from the list of scores. *Sort the list of unique scores in descending order. *Print the second element in the sorted list, which represents the runner-up score. question 3 *Convert the input string s into a list of characters. *Update the character at the specified position in the list with the new character. *Join the list of characters back into a string using the join() method. *Return the modified string. question 4 *Split the input string s into substrings of length k. *For each substring: *Create a new string by removing subsequent occurrences of non-distinct characters. *Print the new string on a new line. question 5 *Iterate from 1 to number. *For each number: *Convert it to decimal, octal, hexadecimal, and binary representations. *Pad each representation with leading zeros. *Print the formatted values on a single line, separated by spaces. question 7 *Read the month, day, and year from the input. *Extract the month, day, and year from the input. *Use calendar.weekday() to find the day of the week. *Convert the integer returned by calendar.weekday() into the corresponding day name. *Print the day name in capital letters. question 8 *import namedtuple from collections. *Read the total number of students n. *Read the column names and split them into a list. *Define a namedtuple called Student with the column names. *Use list comprehension to create a list of namedtuples, each representing a student, by reading the input and splitting it into respective fields. *Calculate the sum of marks using a generator expression and compute the average by dividing it by n. *Print the average marks formatted to 2 decimal places.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages