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

Python Assignment - Day 6

The document outlines a programming practice assignment focused on Python, with a duration of 2 hours. It includes three tasks: extracting players registered only for basketball, calculating total scores for players in a game, and identifying the shortest and longest words from a user-inputted sequence. Each task provides specific problem statements and examples to guide the implementation.

Uploaded by

rmanimaran911
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)
6 views3 pages

Python Assignment - Day 6

The document outlines a programming practice assignment focused on Python, with a duration of 2 hours. It includes three tasks: extracting players registered only for basketball, calculating total scores for players in a game, and identifying the shortest and longest words from a user-inputted sequence. Each task provides specific problem statements and examples to guide the implementation.

Uploaded by

rmanimaran911
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
You are on page 1/ 3

Practice Assignment – 6

Programming with Python

Techademy
CONTENTS
1 Duration .......................................................................................................................................... 2
2 Problem Statements ....................................................................................................................... 2
2.1 Task 1: Extract players ............................................................................................................ 2
2.2 Task 2: Calculate scores ......................................................................................................... 2
2.3 Task 3: Shortest and longest words…………………………………………………………………………………….2

1
1 DURATION
2 Hours

2 PROBLEM STATEMENTS

2.1 Task 1: Extract Players

You work at a sports club. The following sets contain the names of players registered to
play different sports:

football_players = ["Eve", "Tom", "Richard", "Peter"]


volleyball_players = ["Jack", "Hugh", "Peter", "Sam"]
basketball_players = ["Eve", "Richard", "Jessica ",
"Sam", "Michael"]

How can you obtain a set that includes the players that are only registered to play
basketball (i.e. not registered for football or volleyball)?

2.2 Task 2: Calculate Scores

Three friends are playing a game, where each player has three rounds to score. At the end, the
player whose total score (i.e. the sum of each round) is the highest wins. Consider the scores below
(formatted as a list of tuples):

scores = [('Mike', 10), ('Mike', 8), ('Mike', 6), ('John', 7),


('John', 8), ('John', 5), ('John', 8), ('Tom', 8), ('Tom', 9)]

Create a dictionary where each player is represented by the dictionary key and the corresponding
total score is the dictionary value.

2.3 TASK3: LONGEST AND SHORTEST WORDS

Input a sequence of words from the user, and output the shortest and longest word in the sequence

Example: Input: apple ball cat

Output:

Shortest: cat

Longest: apple

You might also like