Writing a loop with a step size 10, to print out all 2-digit numbers ending in 7 in increasing order in python

StackOverflow https://stackoverflow.com/questions/16313987

  •  13-04-2022
  •  | 
  •  

Domanda

Write a program, using a for loop with step size 10, to print out all 2-digit numbers which end in 7, in increasing order

I have no idea where to start, or how to do this. help please!

È stato utile?

Soluzione

range

range(stop)

range(start, stop[, step])

>>> for n in range(17, 100, 10):
        print n

        
17
27
37
47
57
67
77
87
97
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top