In: Computer Science
Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax.
NOTE:User not mentioned particular language so I choose python
I choose python language to print a list of numbers starting 64 and ending 339 .
def printValues(): #defing a function
l = list() #creating a list to store numbers and print as a list numbers
for i in range(64,340): #range(starting num,ending num+1) here ending num+1 is due to ending num not displayed so we add one to it so it will be displayed
l.append(i) #l.append(i) adding i in list l
print(l) #displaying the list of numbers using print()
printValues() #calling the function so it will run the function and execute the code in function
output:
if you decided to not include 339 use range(64,339)
If you want print numbers between 64 and 339 use range(65,339)
# Do upvote if you understand the code Thank you