58,394 views
39 votes
39 votes
Python problem: The program needs to output the numbers 1 to 9, each on a separate line, followed by a dot:

User Harti
by
2.9k points

1 Answer

27 votes
27 votes

Answer:

for i in range(1,10): print("{}.".format(i))

Step-by-step explanation:

here's a one liner that does what you need.

User Andriy Zakharko
by
2.8k points