0% found this document useful (0 votes)
14 views1 page

List Assignment

List assignment Pyhton

Uploaded by

50015713
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)
14 views1 page

List Assignment

List assignment Pyhton

Uploaded by

50015713
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/ 1

List Assignment Marks: 20

1. Mr. Delnea, Mr Ing and I play scrabble every year at the All-Night Dance/Social. I constantly focus on
improving my game. I want a program that allows me to review my plays so I can get rid of the words
that were below average. Write a program that allows me to enter a series of words and how much they
were worth then display a list of words that gave me below average scores so that in the future I will try
to avoid these scores. Please don’t give your program to Mr. Delnea, he already has an unfair advantage,
being an English teacher and all.
save as listAssign1.py (4 marks)

2. Setting up matches for a single elimination tournament is fairly straightforward. All you need to do is
randomly assign the first round of games and the rest is all deterministic (there are no more choices to
make) Create a program that allows the user to enter as many names as he or she wants and display the
random pairings for the first round. If there are an odd number of players then add in a player called
"Bye" Your program should display the results in a nice neat table.
save as Assign2.py (5 marks)

3. I re-played all of your trivia programs for about eight hours last weekend and I just don't feel that much
smarter. I want you to make another trivial program, but this time I want the information to be more
useful. Since Canada's Confederation in 1867 there have been 29 terms of office for Prime Minister, and some of
the prime ministers have served multiple terms. Create a program that quizzes the user's knowledge of Canadian
prime ministers. You program must ask 10 questions. Each time it will give the user the term number, and the
dates of the term and the user will give the last name of the prime minister. These questions must be randomly
picked, and the questions must not repeat. Give the user feedback as they answer questions and when they are
done, tell them what percentage they got right and give a comment that reflects their level of knowledge.
save as listAssign3.py (5 marks)

4. The game of Assassin is a simple game played on university campuses where each player is assigned a
target to assassinate by simply saying “you’re dead” to them. Of course, with thousands of people on
campus and only a few dozen in the game you never know who is looking to assassinate you. Once you
assassinate someone you take on the target they were looking for. If this happens to be you then you are
the winner. To ensure that this works properly the targets must form a continuous “chain.” Write a
program that allows the user to enter their target assignments and output whether it is valid or not. based
on if there is a continuous “chain.” Each person in the list is represented by position in the list. The
value at the position is their target. E.g.
0 1 2 3 4 5 6
4 3 0 5 6 2 1 Valid
Can be drawn as:
6 1
4
0
3
2 5

5 0 3 4 2 1 Invalid – two separate groups

2 0 3 0 4 0 5 Invalid – numbers repeat and missing


save as listAssign4.py (6 marks)

note: your program does not need to say why a configuration is invalid.
For more info: https://en.wikipedia.org/wiki/Assassin_(game)

You might also like