Answer to Question #257343 in Python for asdiawyeiuo

Question #257343

I wanna experiment on looping through a range of numbers that will be randomly inputted by the user. However, I don't want to let them see the loading percentage that is divisible by 4, so please exclude those for me when printing it out.

Thank you!

Instructions

  1. Create two variables and assign them to an input() function. The first variable will accept the starting integer and the second one will accept the ending integer of the range.
  2. Use the power of loops to loop through the range of the first inputted integer until the second one (inclusive), and print out the number with the correspoinding format shown on the sample output, with each statement separated on each line.
  3. However, skip the printing of statement if the integer is divisible by 4.
  4. Tip: Utilize the continue keyword to complete the process.

Input

A line containing two integers separated by a space.

2·10

Output

Multiple lines containing a string and an integer.

Loading...2%
Loading...3%
Loading...5%
Loading...6%
Loading...7%
Loading...9%
Loading...10%






1
Expert's answer
2021-10-27T16:23:40-0400
a = int(input())
b = int(input())


for i in range(a, b + 1):
    if i % 4 == 0:
        continue
    print('Loading...{0}%'.format(i))

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS