Question: python program plasse Write a program to find if the user wins a prize in a special lottery (piyango). The lottery ticket numbers are 4

python program plasse Write a program to find if the user winspython program plasse

Write a program to find if the user wins a prize in a special lottery (piyango). 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 10TL 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

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!