TORONTO KIDS COMPUTER CLUB | Saturday 14:00 Python Homework 10.20.
15888
post-template-default,single,single-post,postid-15888,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

Saturday 14:00 Python Homework 10.20.

22 Oct Saturday 14:00 Python Homework 10.20.

Question:

Please write a program using function. Each player in a tournament plays six games. There are no ties. The tournament director places the players in groups based on the results of games as follows:

  • if a player wins 5 or 6 games, they are placed in Group 1;
  • if a player wins 3 or 4 games, they are placed in Group 2;
  • if a player wins 1 or 2 games, they are placed in Group 3;
  • if a player does not win any games, they are eliminated from the tournament.

Write a program to determine which group a player is placed in.

The input consists of six lines, each with one of two possible letters: W (to indicate a win) or L (to indicate a loss).


Sample Input 1:
W
L
W
W
L
W

Sample output 1:
Group 2


Sample Input 2:
L
L
L
L
L
L

Sample output 2:
Group -1

No Comments

Sorry, the comment form is closed at this time.