10.1k views
1 vote
4.8 Code Practice: Question 1

Instructions
Write a for loop to print the numbers 5, 10, 15 … 75 on one line.

Expected Output
5 10 15 20 25 30 35 40 45 50 55 60 65 70 75

2 Answers

7 votes

Answer:

for x in range(1, 16):

print(x * 5, end=" ")

Step-by-step explanation:

Hope this helps!

User Dracodoc
by
5.9k points
2 votes

Answer:

c = 1 # global variable

jhjl jh

def add(): c = 1 # global variable

def add():

print(c)

add()

c = c + 2 # increment c by 2

print(c)

add()

Step-by-step explanation:

User Zajca
by
4.9k points