Pagina de inicio
/
Tecnología
/
operation. 317-delete gy > import os message file = "317-message .txt if os.path.exists(message file): os.remove(nessage file) 6 print("Nessage file removed", s else: print("There was no message file to remove a. What do lines 4 through 6 do? square output operations i. __ b. What does the else statement on lines 8 and 9 do? i __

Problemas

operation.
317-delete gy >
import os
message file = "317-message .txt
if os.path.exists(message file):
os.remove(nessage file)
6	print("Nessage file removed",
s else:
print("There was no message file to remove
a. What do lines 4 through 6 do?
square 
output operations
i.
__
b. What does the else statement on lines 8 and 9 do?
i
__

operation. 317-delete gy > import os message file = "317-message .txt if os.path.exists(message file): os.remove(nessage file) 6 print("Nessage file removed", s else: print("There was no message file to remove a. What do lines 4 through 6 do? square output operations i. __ b. What does the else statement on lines 8 and 9 do? i __

Solución

avatar
Pedroprofessionell · Tutor durante 6 años
expert verifiedVerificación de expertos
4.4 (320 votos)

Responder

a. Lines 4 through 6 check if the message file exists and remove it if it does. If the file does not exist, it prints a message indicating that there was no file to remove.<br /><br />b. The else statement on lines 8 and 9 provides an alternative action if the message file does not exist. It prints a message indicating that there was no message file to remove.
Haz clic para calificar: