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])
Answer:
C I believe but I'm not a hundred percent sure
Answer: implicit
Explanation:
When a value of one data type is assigned to a variable of another data type, then Visual Basic attempts to perform an implicit type conversion.
Implicit type conversion, simply refers to when one data type is converted automatically by Python to another data type. It should be noted that no user involvement is needed.
largest = int(input("Enter a number: "))
print("Largest: {}".format(largest))
i = 0
while i < 5:
num = int(input("Enter a number: "))
if num > largest:
largest = num
print("Largest: {}".format(largest))
i += 1
I hope this helps!