0% found this document useful (0 votes)
69 views3 pages

Python Programming Assignment Tasks

The final task asks you to write a Python program to remove a given key from a dictionary.

Uploaded by

chiefsgs
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)
69 views3 pages

Python Programming Assignment Tasks

The final task asks you to write a Python program to remove a given key from a dictionary.

Uploaded by

chiefsgs
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

Instructions

➔ Please write all the programs on a document file and upload it for evaluation.
➔ Please do not write any type of source code in the description box.
➔ The system will automatically check your submission against the predefined plagiarism
detection criteria. Plagiarised answers will cause you to fail the assignment.
➔ You can submit your assignment in the form of a doc, text, or pdf file.
➔ Corrupted files will cause you to fail the assignment.
➔ Please ensure that you have written your name and email address on the answer
document you have submitted.
____________________________________________________________________________

Challenging Task-Peer Assessment 1


____________________________________________________________________________

Asha has a huge collection of country currencies. She decided to count the total number of
distinct country currencies in her collection. She asked for your help. You pick the currency one
by one from a stack of country currencies.

Find the total number of distinct country currencies.

Input Format:
The first line contains an integer N , the total number of country currencies.
The next N lines contains the name of the country where the currency is from

Sample Input and Output


Enter Number of Currencies 3

Enter the name of the country India


1
Enter the name of the country USA
2
Enter the name of the country Japan
3
____________________________________________________

Challenging Task-Peer Assessment 2


____________________________________________________________________________

A startup company named 'MY_Chat' having four employees names as Sunny, Ravi, Vijay and
Messi having the respected salaries are 25000,23000, 26000, and 30000.

After six months, Sunny resigned from his job. Update data based on employee name.

Input format: Sunny


Output format: all employee data after update

____________________________________________________

Challenging Task-Peer Assessment 3


____________________________________________________________________________

Write a Python Program to Check if a Given Key Exists in a Dictionary or Not.

____________________________________________________

Challenging Task-Peer Assessment 4


____________________________________________________________________________

A quiz was conducted in a programming tutorial class for 10 marks. Calculate Mean and
Standard Deviation of the marks scored by minimum seven students in the class. Use the
appropriate functions provided by Python.

Input format: Enter 7 integers with spaces


Output format: Mean is:
Standard Deviation is:
____________________________________________________

Challenging Task-Peer Assessment 5


____________________________________________________________________________

School attendance register needs to be prepared with several columns. Amongst ‘Name’
column size need to be decided based on the longest word in the list of students’ names.

The program takes a list of words and returns the word with the longest length. If there
are two or more words of the same length then the first one is considered.

Input format : One integer (Number of Words) followed by list words separated by
newline or enter

Output format : The word with the longest length is:

____________________________________________________

Challenging Task-Peer Assessment 6


____________________________________________________________________________

Python Program to remove the given key from a dictionary.

Common questions

Powered by AI

In a dynamic organization like MY_Chat, updating employee data poses challenges like maintaining data accuracy and ensuring seamless transitions when staff changes occur. A proper solution is implementing a reliable data management system that updates records promptly and reflects these changes in related databases or reports, thus ensuring that information is current and reliable for decision-making .

To update the employee data when Sunny resigns, remove Sunny's entry from the list of employees, and maintain the data for the remaining employees, Ravi, Vijay, and Messi with their respective salaries of 23000, 26000, and 30000 .

In Python, remove a given key from a dictionary using the 'pop()' method, which requires specifying the key to be removed. Another method is to use 'del', such as 'del dictionary[key]', provided the key exists to avoid a KeyError .

To count distinct country currencies, read an integer N representing currencies to be processed, followed by the names of their countries. Use a set to store unique country names as you iterate through the input. This approach efficiently manages duplicates and provides the total count of distinct entries .

In Python, one can use the 'in' keyword to check if a given key exists in a dictionary. This involves writing a condition like 'if key in dictionary:', which evaluates to True if the key is present in the dictionary, and False otherwise .

To ensure the integrity of file submissions, students must avoid writing source code in the description box and upload a document file (doc, text, or pdf) that is not corrupted. The submission should include the student's name and email address, and avoid plagiarism as unauthorized copying will result in assignment failure .

To determine the longest word, input the total number of words followed by each word in the list. Iterate through this list to find the word with the maximum length. If multiple words share this length, select the first occurrence. This approach is pivotal in setting column sizes in a school attendance register, where uniformity and clarity in data presentation are considered .

Convert the list of currency names into a set data structure since sets inherently disallow duplicates. This conversion automatically filters the data for unique instances, enabling an accurate count of distinct currencies for inventory purposes, as demonstrated in the structured task .

Non-compliance with submission guidelines leads to severe repercussions such as assignment failure. This may occur if files are corrupted, lack proper identification, or contain plagiarized content. Such outcomes emphasize the necessity of meticulous adherence to instructions to uphold academic standards and integrity .

To calculate the mean and standard deviation of student marks in Python, input at least seven integers. Calculate the mean by summing the numbers and dividing by the count. Use functions from libraries like 'statistics' to compute the standard deviation, ensuring precision in the calculation .

You might also like