answersLogoWhite

0

Why wont my for loop work in python?

Updated: 12/13/2022
User Avatar

SaraKopenecfb7780

Lvl 1
6y ago

Want this question answered?

Be notified when an answer is posted

Add your answer:

Earn +20 pts
Q: Why wont my for loop work in python?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is a Python loop?

A Python loop is something that will always happen or continue to happen until the condition isn't met. So for example:while 1==1:print("Infinite loop")would be an infinite loop, as 1 will ALWAYS be equal to 1.


How do you thyroid and parathyroid form a feedback loop?

The thyroid is in charge of metabolism, the parathyroid is in charge of what amount the thyroid regulates. If either of the two are out of sorts the feedback loop wont work.


How do you loop a program in python 3?

A program can be looped in Python by wrapping the entire program in a for or while loop. If you wish to loop the program a finite amount of times, it can be done like so (x = the amount of times you want it to loop, this can be a number or variable storing a number): for i in range(0,x): [code] If you wish to loop the program infinitely, you can use a simple while loop: while True: [code]


How do you loop a program in python?

An infinite loop might look something like: while 1==1: print("Infinite loop") as 1 is ALWAYS equal to 1.


What is the best first computer language to learn?

Python is good. But not if you wont to build on that language as python is pretty much python only, as well as pygame which is fun.


Why does python need camouflage to hunt?

they camoflage so their prey wont see them


Did Harvey Kutzman work with Monty Python?

No. He did work with Terry Gilliam, who was a member of the Monty Python team later.


How do you create a loop (for loop, while loop) in Python?

In Python, you can create loops using different constructs, such as the for loop and the while loop. These loops allow you to repeatedly execute a block of code until a specific condition is met. Here's how you can create loops in Python: for loop: A for loop is used when you want to iterate over a sequence of elements such as a list, tuple, or string. It executes a block of code for each item in the sequence. for item in sequence: # Code block to be executed Here's an example that prints the numbers from 1 to 5 using a for loop: for num in range(1, 6): print(num) 2 while loop: A while loop is used when you want to repeat a block of code as long as a certain condition is true. It keeps executing the code block until the condition becomes false. while condition: # Code block to be executed Here's an example that prints the numbers from 1 to 5 using a while loop: num = 1 while num


Can stick bugs live with pythons?

Yes the python wont pay any attention to it


Can python work on vista?

Yes,Python works on almost every Operating System.


Did Mel Brooks work with Monty Python?

No


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