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

Since programming language is not mentioned in the question, So I am assuming it as python language.

Below is the python code for mentioned problem statement:

In this we use for loop with range and also implement with while loop :

# Program will start from main function
if __name__ == '__main__':
    start_num = 64
    end_num = 339
    # declare a empty list
    result_list = []
    # using for loop iterate the number from 64 to 339 using range(start , end)
    for x in range(64, 340):
        # print("num : ", x)
        # Append the number in a list
        result_list.append(x)
    #     Showing the result
    print("List of numbers using for loop : ", result_list)


    # Using while loop:
    result_list = []
    while start_num <=339:
        result_list.append(start_num)
        start_num = start_num + 1
    print("List of numbers usi g while loop : ", result_list)


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.(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.
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