Answer:
scope of pet name is limited to pet class and color is accessible to the whole program
Explanation:
Answer:
A.Use rounding to get -6(0.2), and then multiply. and D. use front end estimation to get -6(0.2), and multiply. and B.
Explanation:
just took the test
Answer:
Explanation:
iname=input("Enter the file name: ")
inputfile=open(iname,'r')
lines=[]
for line in inputfile:
lines.append(line)
inputfile.close()
print("The file has ",len(lines)," lines")
while True:
linenumber=int(input("Enter the line number or 0 to quit: "))
if linenumber==0:
break
elif linenumber > len(lines):
print("Error: line number must be less than ", len(lines))
else:
print(linenumber, " : ", lines[linenumber - 1])