Question: Python 3.6 The user has an option to either input 2 numbers or read from a txt file.The objective is to get the greatest common

Python 3.6

The user has an option to either input 2 numbers or read from a txt file.The objective is to get the greatest common divisor. When doing txt file,I have to read each line of "GCD.txt" - and there are 2 numbers on each line. After reading the 2 numbers on each line, I must get the GCD. If the user inputs 2 numbers onto the keyboard, then I have to directly output the GCD. Please make the necessary changes to my source code. I'm using Mac OS , so reading files can be different from Windows. Please provide corrected indented source code and screenshot of output for full credit.Thanks. Below is the following necessary information:

Python 3.6 The user has an option to either input 2 numbers

or read from a txt file.The objective is to get the greatest

if b a: while b l= 0: 10 a=t return a 12 13 14 15 16 17 def read file() myfile = open ("GCD.txt'') mytxt-myfile.read() myfile.close( 19 20 21 print("Option 1: Read from a filel ") print("Option 2: Input information onto the keyboard ") k = (input ("What would you like to do?")) if k == 1: 23 24 25 26 27 28 print(input("What is your 2 numbers that you would like to find the Greatest Common Divisor for? )) elif k =-2: print(input ("What is the file's name?") )

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!