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

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. Ctrl 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
Get step-by-step solutions from verified subject matter experts
