answersLogoWhite

0


Best Answer

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

LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor
TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga

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
Related questions

Can you run a python program using code Can you give me the code I need to use in order for it to work I am using codio plz help?

Assuming you only intend executing your code on your own machine and you have some version of Python installed, you can execute a Python script from within your code in the same way you can execute a Python script via the command line: python script.py infile outfile -o


How do you make a app using the python programming language and not using py2app?

Py2app for the Mac, or Py2exe for Windows, create a standalone executable file from a Python program, which can run without the Python interpreter. You can always run the application within the Python interpreter. If you want to create an executable file, Python includes no built-in tools to do this; you need an application such as Py2app or Py2exe. Of course, you might search for alternative tools, that do the same thing.


What is the process for generating a random decimal number in Python using the random module?

To generate a random decimal number in Python using the random module, you can use the random.uniform() function. This function takes two arguments, which are the lower and upper bounds of the range from which the random decimal number will be generated. For example, to generate a random decimal number between 0 and 1, you can use random.uniform(0, 1).


Write a program to generate uppercase using cSharp?

string s = "asdfqwer"; s = s.ToUpper(System.Globalization.CultureInfo.CurrentCulture);


How do you generate a parse tree from an expression using C program?

c code for top down parser


What is the purpose of using the np.random.choice seed in generating random numbers in Python?

The purpose of using the np.random.choice seed in generating random numbers in Python is to ensure that the random numbers generated are reproducible and consistent across different runs of the program. This allows for easier debugging and testing of the code.


Program to generate Fibonacci series using storage class in c plus plus?

i dn't know. haha


Write a c program to generate student mark details using union and find total and average and grade?

write a c program to display marks,total,average,grade using union


Can EXCEL generate different permitations?

Using the Permut function, you can find out how many permutations can be got from a set of values. To actually generate the individual permutations you would need a program.


How can I implement a Huffman code in Python?

To implement a Huffman code in Python, you can follow these steps: Create a frequency table of characters in the input text. Build a Huffman tree using the frequency table. Generate Huffman codes for each character in the tree. Encode the input text using the generated Huffman codes. Decode the encoded text back to the original text using the Huffman tree. You can find Python libraries and code examples online to help you implement these steps effectively.


How do you make a program in python using do while loop to display the multiplication table of number from one to ten?

a = 0while a < 10 :a += 1print (a)Write the above simple script in a text editor (I use nano). Save as loop.py in home folder. To run, open a terminal and at the prompt, write: python loop.pyResult:rodney@downstairs:~$ python loop.py12345678910


How to generate multi component sine wave signal by using matlab program?

Generating Sine and Cosine Signals (Use updated lab)