Question

In: Computer Science

Write a loop to print a list of numbers starting at 64 and ending at 339....

Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax.

Solutions

Expert Solution

After getting your question I have two solutions in my mind I am showing these. Even you dint mention the language so I used python.

num_list=[]
for i in range(64,340): #looping from 64 to 339
  num_list.append(i)
print("Numbers starting at 64 and ending at 339:")
for j in num_list:
  print(j)

Output:

num_list=[]
for i in range(0,1000): #looping through 0 to 1000 as there will be lots of number so just assuming 1000
  num_list.append(int('64'+str(i)+'339'))#concatenating 64 at the beginning and 339 at the end then converted them into int
print("Numbers starting with 64 and ending with 339:")
for j in num_list: #printing the elements
  print(j)

Please let me know if this is what you have asked for. Any query you can ask in the comment.Thanks


Related Solutions

Write a loop to print a list of numbers starting at 64 and ending at 339....
Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax.
Write a loop to print a list of numbers starting at 64 and ending at 339....
Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax.
Write a loop to print a list of numbers starting at 64 and ending at 339....
Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax.(java language)
Write a loop to print a list of numbers starting at 64 and ending at 339....
Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax.
Write a loop to print a list of numbers starting at 64 and ending at 339....
Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax. in java
Write a loop to print a list of numbers starting at 64 and ending at 339....
Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax.
Write a loop to print a list of numbers starting at 64 and ending at 339....
Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax.
1.Write a loop to print a list of numbers starting at 64 and ending at 339....
1.Write a loop to print a list of numbers starting at 64 and ending at 339. Justify your syntax. 2. Write a switch statement that uses the colour of a swab sample of COVID testing vehicle to send a message to a local doctor. Use the messages given for each colour in the table below. Justify your answer. Colour Message Blue “No virus” Yellow “Needs to be under observation” Red “Needs to be admitted in COVID ward” 3.
Write a for-loop in MATLAB that generates a list of numbers such that each number is...
Write a for-loop in MATLAB that generates a list of numbers such that each number is the sum of the previous three. Initialize your list of numbers at the values of 0, 0 and 1. In other words, "0" is the first element of the list, "0" is the second element of the list, and "1" is the third element of the list. What is the 20th value in the list?
Please, write a loop to print odd numbers an array a with pointers backwards. You can...
Please, write a loop to print odd numbers an array a with pointers backwards. You can use a variable “size” for array size.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT