Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. Write a program to find if the user wins a prize in a special lottery (plyanko). The lottery ticket numbers are 4 digits starting

image text in transcribed
. Write a program to find if the user wins a prize in a special lottery (plyanko). The lottery ticket numbers are 4 digits starting from 1000 ending with 9999. The winning number is in a file called winNum.txt (Just one line, with a 4-digit number). The program reads the winning number from winNum.txt file, asks the user to enter his/her 4-digit ticket number, checks if number is valid (1000-9999), then displays the prize: 1000TL if all 4 digits match or 107. if only the last digit matches. The program output should be displayed exactly as shown in the example outputs below depending on what user enters. Example outputs, assuming winNum.txt file contains 7548. Enter ticket number: 123 Enter ticket number: 7548 Enter ticket number: 9348 The number should be 1000-9999 You won 1000TL You won 10TL Enter ticket number: 1223 Better luck next time python

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

What is a step cost?

Answered: 1 week ago