Apr-09-2023, 05:01 AM
(This post was last modified: Apr-09-2023, 05:02 AM by Username0089098.)
I am trying to read a file using a switch case and an input.
1 2 3 4 5 6 7 8 9 10 11 12 |
while True : choice = input ( "(1) Write A File\n(2) Read A File\n(3) Append A File\n\n" ) match choice: case 1 : pass case 2 : file_name = input ( "Enter The File Name: " ) file_name = open (file_name, "r" ) print (file_name) file_name.close() case 3 : pass |