answersLogoWhite

0

In order to display multiples of 9 up to 500 I would use a while loop with the condition number < 500. For example:

#set number to the first multiple of 9

number = 9;

while number < 500:

print number;

#add 9 to the number

number += 9;

Note: I put semicolons at the end of each line out of habit. Python does not require this.

Note: lines beginning with # are comments

The above code will print the current value of number, then add 9 to it. It will continue to do this until number is greater than or equal to 500.

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor

Add your answer:

Earn +20 pts
Q: Program for generate multiples of 9 upto 500 using PYTHON?
Write your answer...
Submit
Still have questions?
magnify glass
imp