Reputation: 1
Can someone help me with this piece of code ?
Write a python program that shows the first 20 results of the hitting process in .7
a=0
while a<=20:
a+=1
print(a*7)
Upvotes: 0
Views: 49
Reputation: 881
you could try using for
instead of while
for n in range(1,21):
print(n*7)
Or
[print(n*7) for n in range(1,21)]
For faster process
Upvotes: 0
Reputation: 13
Your code does what it is supposed to. You just need to watch out how you indent it, try this:
a=0
while a<=20:
a+=1
print(a*7)
Upvotes: 1