Question: Introduction to Python You are expected to write a code which redeems lottery tickets based on the following instructions: The program starts by asking the

Introduction to Python

You are expected to write a code which redeems lottery tickets based on the following instructions: The program starts by asking the user how many tickets they have in order to increase efficacy and redeem the users tickets in a single run. Each lottery ticket has 4 rows that contain 4 digit numbers. After the user enters how many tickets they own, the program goes ticket by ticket, and asks the 4 digits number in each one by one. If the number in any given row can be divided by 7, the user earns $10. If it cant be divided by 7, then user gets $1 for that row. So for any given ticket, user can earn 4$ in the worst case scenario, and $40 in the best case scenario. (Given that each ticket has 4 rows) As said, program should execute operations row by row, meaning after a user enters the 4 digit code on the ticket, the program calculates the prize for that row and stores it, which will be printed at the very end of the program. The program should also print out the information of rows and ticket numbers each time a new ticket or row is introduced (Look at the sample run, youll understand what this clause means) Assume that user always enters a positive integer for the amount of tickets and 4 digit positive integers for each row, you dont need to check if the inputs are valid. To get the indentation of Ticket #NUMBER and Row#NUMBER as shown in the sample run, use the trailing space command.

Introduction to Python You are expected to write a code which redeems

How many tickets do you have?: 3 Ticket # 1 Row # 1 What is your four digit code for this row?: 6741 Row # 2 What is your four digit code for this row?: 1111 Row # 3 What is your four digit code for this row?: 6453 Row # 4 What is your four digit code for this row?: 9009 Ticket # 2 Row # 1 What is your four digit code for this row?: 3724 Row # 2 What is your four digit code for this row?: 1141 Row # 3 What is your four digit code for this row?: 8764 Row # 4 What is your four digit code for this row?: 6720 Ticket # 3 Row # 1 What is your four digit code for this row?: 1542 Row # 2 What is your four digit code for this row?: 2576 Row # 3 What is your four digit code for this row?: 7642 Row # 4 What is your four digit code for this row?: 1734 You won 75 dollars

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!