Site icon Doc Sity

George Mason University The Open Command in Python Exam Practice

George Mason University The Open Command in Python Exam Practice

Question Description

Q1.Which of the following is correct about the open command in python? multiple answers

The open command does not require a close command when working with files

Q2.

The text file must be stored in the exact same directory as the python file working with the text file. Meaning you cannot designate a separate path.

True

False

Q3. Review the following code and match which each item of code is doing:

filename = ‘dog.txt’

with open(filename) as dog.object

for dog in dog.object

print(dog.rstrip())

this code won’t work because it is missing a read command

Q4.


whats is true about classes from the below answers

Debug and script in Google Collab.

prompt = “nWhat is one of your favorite numbers:”

prompt = “nIf you would like to stop enter quit.”

while True:

number = input(prompt)

if number = ‘quit’

break

else: print(“What is another of your favorite number:”)

Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Exit mobile version