Week 5 Programming Assignment: (Https://swayam - Gov.in)
Week 5 Programming Assignment: (Https://swayam - Gov.in)
Week 5 Programming Assignment: (Https://swayam - Gov.in)
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
reviewer4@nptel.iitm.ac.in
Announcements (announcements)
Week 2 Quiz
Here are some basic facts about tennis scoring: A tennis match is made up of
Week 2 sets. A set is made up of games.
Programming To win a set, a player has to win 6 games with a difference of 2 games. At 6-6,
Assignment
there is often a special tie-breaker. In some cases, players go on playing till one
of them wins the set with a difference of two games.
Week 3: Lists,
inductive Tennis matches can be either 3 sets or 5 sets. The player who wins a majority
function of sets wins the match (i.e., 2 out 3 sets or 3 out of 5 sets) The score of a match
definitions, lists out the games in each set, with the overall winner's score reported first for
sorting each set. Thus, if the score is 6-3, 5-7, 7-6 it means that the first player won the
first set by 6 games to 3, lost the second one 5 games to 7 and won the third
Week 3 one 7 games to 6 (and hence won the overall match as well by 2 sets to 1).
Programming
You will read input from the keyboard (standard input) containing the results of
Assignment
several tennis matches. Each match's score is recorded on a separate line with
th f ll i f t
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 1/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
Week 4 Quiz indicates that Halep beat Wozniacki 3-6, 6-3, 6-3 in a best of 3 set match.
The input is terminated by a blank line.
Week 4
You have to write a Python program that reads information about all the
Programming
Assignment
matches and compile the following statistics for each player:
1. Number of best-of-5 set matches won
Week 5: 2. Number of best-of-3 set matches won
Exception 3. Number of sets won
handling, 4. Number of games won
input/output, file 5. Number of sets lost
handling, string 6. Number of games lost
processing
You should print out to the screen (standard output) a summary in decreasing
Week 5 order of ranking, where the ranking is according to the criteria 1-6 in that order
Programming (compare item 1, if equal compare item 2, if equal compare item 3 etc, noting
Assignment that for items 5 and 6 the comparison is reversed).
For instance, given the following data
Week 5
Programming
Assignment
Federer:Nadal:2-6,6-7,7-6,6-3,6-1
Nadal:Federer:6-3,4-6,6-4,6-3
(/noc19_cs40/progassignment?
name=95) Federer:Nadal:6-0,7-6,6-7,6-3
Nadal:Federer:6-4,6-4
Week 6: Federer:Nadal:2-6,6-2,6-0
Backtracking, Nadal:Federer:6-3,4-6,6-3,6-4
scope, data Federer:Nadal:7-6,4-6,7-6,2-6,6-2
structures; Nadal:Federer:7-5,7-5
stacks, queues Halep:Wozniacki:3-6,6-3,6-3
and heaps
Week 6 Quiz
your program should print out the following
Week 8
Programming
Assignment
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 2/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
Download Federer:Djokovic:2-6,6-7,7-
videos 6,6-3,6-1
Djokovic:Federer:6-3,4-6,6-
Text Transcripts 4,6-3
Federer:Djokovic:6-0,7-6,6-
Online 7,6-3 Federer 3 1 13 142
Programming Djokovic:Federer:6-4,6-4 16 143
Test - Sample Test Federer:Djokovic:2-6,6-2,6- Djokovic 2 2 16 143
Case 1 0 13 142
Online Djokovic:Federer:6-3,4-6,6- Halep 0 1 2 15 1 12
Programming 3,6-4 Barty 0 0 1 12 2 15
Test 1, 26 Sep Federer:Djokovic:7-6,4-6,7-
2019, 09:30- 6,2-6,6-2
11:30 Djokovic:Federer:7-5,7-5
Halep:Barty:3-6,6-3,6-3
Online
Programming
Test 2, 26 Sep Halep:Medvedev:2-6,6-7,7-6,
2019, 20:00-
6-3,6-1
22:00
Williams:Medvedev:6-3,4-6,6
-4,6-3
Medvedev:Thiem:6-0,7-6,6-7,
6-3
Halep 2 2 10 75 6 6
Thiem:Medvedev:6-4,6-4
0
Halep:Medvedev:2-6,6-2,6-0
Medvedev 2 0 11 122
Thiem:Medvedev:6-3,4-6,6-3,
Test 16 139
6-4
Case 2 Williams 2 0 7 68 7
Medvedev:Thiem:7-6,4-6,7-6,
71
2-6,6-2
Thiem 1 2 14 133 13
Thiem:Williams:7-5,7-5
128
Halep:Williams:3-6,6-3,6-3
Halep:Thiem:0-6,0-6,6-0,6-
0,7-5
Williams:Thiem:6-3,4-6,7-6,
0-6,7-5
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 3/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
Djokovic:Zverev:2-6,6-7,7-
6,6-3,6-1
Zverev:Djokovic:6-3,4-6,6-
4,6-3
Djokovic:Zverev:6-0,7-6,6-
7,6-3
Zverev:Djokovic:6-4,6-4
Djokovic:Zverev:2-6,6-2,6-0
Zverev:Djokovic:6-3,4-6,6-
3,6-4
Djokovic:Zverev:7-6,4-6,7-
6,2-6,6-2
Williams 3 2 16 160
Zverev:Djokovic:7-5,7-5
16 146
Williams:Muguruza:3-6,6-3,6
Muguruza 3 1 16 146
-3
Test 16 160
Muguruza:Williams:6-4,6-4
Case 3 Djokovic 3 1 13 142
Williams:Muguruza:2-6,6-2,6
16 143
-0
Zverev 2 2 16 143 1
Muguruza:Williams:6-3,4-6,6
3 142
-4,6-3
Williams:Muguruza:6-0,7-6,6
-7,6-3
Muguruza:Williams:6-3,4-6,6
-4,6-3
Williams:Muguruza:6-0,7-6,6
-7,6-3
Muguruza:Williams:6-3,4-6,6
-4,6-3
Williams:Muguruza:6-0,7-6,6
-7,6-3
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 4/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
Halep:Medvedev:2-6,6-7,7-6,
6-3,6-1
Barty:Medvedev:6-3,4-6,6-4,
6-3
Medvedev:Thiem:6-0,7-6,6-7,
6-3
Thiem:Medvedev:6-4,6-4
Halep:Medvedev:2-6,6-2,6-0
Thiem:Medvedev:6-3,4-6,6-3,
6-4
Medvedev:Thiem:7-6,4-6,7-6,
2-6,6-2
Thiem:Barty:7-5,7-5
Halep:Barty:3-6,6-3,6-3
Halep:Thiem:0-6,0-6,6-0,6-
Halep 4 4 20 150 12
0,7-5
120
Barty:Thiem:6-3,4-6,7-6,0-
Medvedev 4 0 22 244
6,7-5
Test 32 278
Halep:Medvedev:2-6,6-7,7-6,
Case 4 Barty 4 0 14 136 14
6-3,6-1
142
Barty:Medvedev:6-3,4-6,6-4,
Thiem 2 4 28 266 26
6-3
256
Medvedev:Thiem:6-0,7-6,6-7,
6-3
Thiem:Medvedev:6-4,6-4
Halep:Medvedev:2-6,6-2,6-0
Thiem:Medvedev:6-3,4-6,6-3,
6-4
Medvedev:Thiem:7-6,4-6,7-6,
2-6,6-2
Thiem:Barty:7-5,7-5
Halep:Barty:3-6,6-3,6-3
Halep:Thiem:0-6,0-6,6-0,6-
0,7-5
Barty:Thiem:6-3,4-6,7-6,0-
6,7-5
Test
Djokovic:Zverev:2-6,6-7,7- Halep 4 4 20 150 12
Case 5
6,6-3,6-1 120
Zverev:Djokovic:6-3,4-6,6- Medvedev 4 0 22 244
4,6-3 32 278
Djokovic:Zverev:6-0,7-6,6- Kerber 4 0 14 136 1
7,6-3 4 142
Zverev:Djokovic:6-4,6-4 Williams 3 2 16 160
Djokovic:Zverev:2-6,6-2,6-0 16 146
Zverev:Djokovic:6-3,4-6,6- Muguruza 3 1 16 146
3,6-4 16 160
Djokovic:Zverev:7-6,4-6,7- Djokovic 3 1 13 142
6,2-6,6-2 16 143
Zverev:Djokovic:7-5,7-5 Thiem 2 4 28 266 26
Williams:Muguruza:3-6,6-3,6 256
-3
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 5/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
Test
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 6/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 7/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
6-3
Thiem:Medvedev:6-4,6-4
Halep:Medvedev:2-6,6-2,6-0
Thiem:Medvedev:6-3,4-6,6-3,
6-4
Medvedev:Thiem:7-6,4-6,7-6,
2-6,6-2
Thiem:Barty:7-5,7-5
Halep:Barty:3-6,6-3,6-3
Halep:Thiem:0-6,0-6,6-0,6-
0,7-5
Barty:Thiem:6-3,4-6,7-6,0-
6,7-5
Djokovic:Zverev:2-6,6-7,7-
6,6-3,6-1
Zverev:Djokovic:6-3,4-6,6-
4,6-3
Djokovic:Zverev:6-0,7-6,6-
7,6-3
Zverev:Djokovic:6-4,6-4
Djokovic:Zverev:2-6,6-2,6-0
Zverev:Djokovic:6-3,4-6,6-
3,6-4
Djokovic:Zverev:7-6,4-6,7-
6,2-6,6-2
Zverev:Djokovic:7-5,7-5
Williams:Muguruza:3-6,6-3,6
-3
Muguruza:Williams:6-4,6-4
Williams:Muguruza:2-6,6-2,6
-0
Muguruza:Williams:6-3,4-6,6
-4,6-3
Williams:Muguruza:6-0,7-6,6
-7,6-3
Muguruza:Williams:6-3,4-6,6
-4,6-3
Williams:Muguruza:6-0,7-6,6
-7,6-3
Muguruza:Williams:6-3,4-6,6
-4,6-3
Williams:Muguruza:6-0,7-6,6
-7,6-3
Halep:Medvedev:2-6,6-7,7-6,
6-3,6-1
Barty:Medvedev:6-3,4-6,6-4,
6-3
Medvedev:Thiem:6-0,7-6,6-7,
6-3
Thiem:Medvedev:6-4,6-4
Halep:Medvedev:2-6,6-2,6-0
Thiem:Medvedev:6-3,4-6,6-3,
6-4
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 8/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
Medvedev:Thiem:7-6,4-6,7-6,
2-6,6-2
Thiem:Barty:7-5,7-5
Halep:Barty:3-6,6-3,6-3
Halep:Thiem:0-6,0-6,6-0,6-
0,7-5
Barty:Thiem:6-3,4-6,7-6,0-
6,7-5
Halep:Medvedev:2-6,6-7,7-6,
6-3,6-1
Barty:Medvedev:6-3,4-6,6-4,
6-3
Medvedev:Thiem:6-0,7-6,6-7,
6-3
Thiem:Medvedev:6-4,6-4
Halep:Medvedev:2-6,6-2,6-0
Thiem:Medvedev:6-3,4-6,6-3,
6-4
Medvedev:Thiem:7-6,4-6,7-6,
2-6,6-2
Thiem:Barty:7-5,7-5
Halep:Barty:3-6,6-3,6-3
Halep:Thiem:0-6,0-6,6-0,6-
0,7-5
Barty:Thiem:6-3,4-6,7-6,0-
6,7-5
Federer:Djokovic:2-6,6-7,7-
6,6-3,6-1
Djokovic:Federer:6-3,4-6,6-
4,6-3
Federer:Djokovic:6-0,7-6,6-
7,6-3 Federer 3 1 13 142
Djokovic:Federer:6-4,6-4 16 143
Test Federer:Djokovic:2-6,6-2,6- Djokovic 2 2 16 143
Case 7 0 13 142
Djokovic:Federer:6-3,4-6,6- Halep 0 1 2 15 1 12
3,6-4 Barty 0 0 1 12 2 15
Federer:Djokovic:7-6,4-6,7-
6,2-6,6-2
Djokovic:Federer:7-5,7-5
Halep:Barty:3-6,6-3,6-3
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 9/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
Halep:Medvedev:2-6,6-7,7-6,
6-3,6-1
Williams:Medvedev:6-3,4-6,6
-4,6-3
Medvedev:Thiem:6-0,7-6,6-7,
6-3
Halep 2 2 10 75 6 6
Thiem:Medvedev:6-4,6-4
0
Halep:Medvedev:2-6,6-2,6-0
Medvedev 2 0 11 122
Thiem:Medvedev:6-3,4-6,6-3,
Test 16 139
6-4
Case 8 Williams 2 0 7 68 7
Medvedev:Thiem:7-6,4-6,7-6,
71
2-6,6-2
Thiem 1 2 14 133 13
Thiem:Williams:7-5,7-5
128
Halep:Williams:3-6,6-3,6-3
Halep:Thiem:0-6,0-6,6-0,6-
0,7-5
Williams:Thiem:6-3,4-6,7-6,
0-6,7-5
Djokovic:Zverev:2-6,6-7,7-
6,6-3,6-1
Zverev:Djokovic:6-3,4-6,6-
4,6-3
Djokovic:Zverev:6-0,7-6,6-
7,6-3
Zverev:Djokovic:6-4,6-4
Djokovic:Zverev:2-6,6-2,6-0
Zverev:Djokovic:6-3,4-6,6-
3,6-4
Djokovic:Zverev:7-6,4-6,7-
6,2-6,6-2
Williams 3 2 16 160
Zverev:Djokovic:7-5,7-5
16 146
Williams:Muguruza:3-6,6-3,6
Muguruza 3 1 16 146
-3
Test 16 160
Muguruza:Williams:6-4,6-4
Case 9 Djokovic 3 1 13 142
Williams:Muguruza:2-6,6-2,6
16 143
-0
Zverev 2 2 16 143 1
Muguruza:Williams:6-3,4-6,6
3 142
-4,6-3
Williams:Muguruza:6-0,7-6,6
-7,6-3
Muguruza:Williams:6-3,4-6,6
-4,6-3
Williams:Muguruza:6-0,7-6,6
-7,6-3
Muguruza:Williams:6-3,4-6,6
-4,6-3
Williams:Muguruza:6-0,7-6,6
-7,6-3
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 10/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 11/12
02/07/2020 Programming, Data Structures And Algorithms Using Python - Course
https://onlinecourses.nptel.ac.in/noc19_cs40/progassignment?name=95 12/12