Question: Q3: Find the errors in the following code and correct them (2 errors): (2 marks) 1. coffee_file = open ('coffee.txt', 'I') 2. print('Enter the following
Q3: Find the errors in the following code and correct them (2 errors): (2 marks) 1. coffee_file = open ('coffee.txt', 'I') 2. print('Enter the following coffee data:') 3. descr = input('Description: ') 4. qty = int (input ('Quantity (in pounds) : ')) 5. coffee file.write (descr + ' + ) 6. coffee_file.write(qty + ) 7. coffeefile.close()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
