🌐
Vista Academy
thevistaacademy.com › home › blog › some important questions of while loop in python to practice (with answers)
20+ While Loop Questions in Python (With Answers & Practice Problems)
May 13, 2026 - Practice key while loop questions in Python with answers. Includes syntax errors, indefinite loops, execution count, and beginner-friendly examples.
🌐
Khan Academy
khanacademy.org › computing › computer-programming › programming › looping › e › review-loops
Using while loops (practice)
Learn for free about math, art, computer programming, economics, physics, chemistry, biology, medicine, finance, history, and more. Khan Academy is a nonprofit with the mission of providing a free, world-class education for anyone, anywhere.
Discussions

Ideas for practicing for and while loops?

For: print out only even numbers between 1 and 100. Now do it without using an if statement.

While: Ask the user for a secret password. Keep going until they get it right. Now do the same without using an if statement.

These are probably the most basic ideas. Once you have them down, you can build on your knowledge.

More on reddit.com
🌐 r/learnpython
34
56
October 2, 2020
Security Megathread: All questions, answers and discussion about smuggling/sniffer dogs etc. IN THIS THREAD ONLY
And for fucksake please be fucking careful mixing ket with booze. More on reddit.com
🌐 r/BoomtownFestival
116
138
August 5, 2019
🌐
Adelphi University
home.adelphi.edu › ~pe16132 › csc171 › loopWhileExercise.htm
while loop exercises
1. Print the instructions 2. Set ... user goes second, have the computer take two sticks. 5. As long as there is no winner, keep playing · 5.1 While there is no winner 5.2 Find out how many sticks the user is taking 5.3 Make sure it’s a valid choice...
🌐
CS-IP-Learning-Hub
csiplearninghub.com › questions-of-while-loop-in-python
40 Important Questions of While loop in Python (Solved) Class 11 - CS-IP-Learning-Hub
January 15, 2023 - Ans. i=1 j=49 while(i<=49 and j>=1): print(i,"---",j) i=i+1 j = j - 1 · Disclaimer : I tried to give you the correct Solution of “programs of while Loop in Python” , but if you feel that there is/are mistakes in the solution of “programs of while Loop in Python“ given above, you can directly contact me at csiplearninghub@gmail.com.
🌐
w3resource
w3resource.com › c-programming-exercises › while-loop › index.php
C Programming: While Loop Exercises with Solutions
July 29, 2025 - Write a C program that prompts the user to input a username. Use a while loop to keep asking for a username until a valid one is entered (e.g., at least 8 characters long). ... Write a C program that calculates and prints the sum of cubes of ...
🌐
Sanfoundry
sanfoundry.com › c-programming-questions-answers-while-loops-1
While Loop - C Language Questions and Answers - Sanfoundry
July 23, 2025 - This set of C Multiple Choice Questions ... will be the output of the following C code? #include int main() { while () printf("In while loop "); printf("After loop\n"); } a) In while ......
🌐
PYnative
pynative.com › home › python exercises › python loops exercises: 40+ coding problems with solutions
40 Python Loops Coding Exercises with Solutions – PYnative
June 13, 2026 - Practice Python loops with 40 coding problems with solutions. Practice for, while, and nested loops. Perfect for beginners and intermediate programmers.
🌐
Tildesites
tildesites.bowdoin.edu › ~ltoma › teaching › cs107 › spring05 › Lectures › while.pdf pdf
The while Loop and Practice Problems Use
where while is a reserved word, boolean-expression is an expression that evaluates to · true or false, and statement is a C++ statement, or a group of statements enclosed by · curly braces (a compound statement). Action · If the boolean expression is true, the specified statement, called the body of the loop, is ·
Find elsewhere
🌐
CodeChef
codechef.com › learn › course › python › LTCPY17 › problems › PYTHCL107
While Loop in Python Programming
Test your Learn Python Programming knowledge with our While Loop practice problem. Dive into the world of python challenges at CodeChef.
🌐
Real Python
realpython.com › quizzes › python-while-loop
Python while Loops: Repeating Tasks Conditionally Quiz – Real Python
The while keyword is used to initiate ... true. A while loop works by evaluating a condition at the start of each iteration. If the condition is true, then the loop executes. Otherwise, it terminates. The quiz contains 11 questions and there is no time limit. You’ll get 1 point for each correct answer...
🌐
Testbook
testbook.com › home › programming and data structure › programming in c › while loop
[Solved] While Loop MCQ [Free PDF] - Objective Question Answer for While Loop Quiz - Download Now!
May 19, 2026 - If the condition were like while ... return false. ... The value returned by func(435)is __________. ... Hence 9 is the correct answer....
🌐
GeeksforGeeks
geeksforgeeks.org › quizzes › python-while-loop-quiz
Quiz about Python While Loop Quiz
In Python, how can you emulate the behavior of a break statement inside a while loop without using bre · Use a return statement. Use a pass statement. Raise a custom exception. Use a goto statement. ... Only if the loop has multiple conditions. Only if the loop uses nested if statements. ... To terminate the loop. To check if a condition is true and raise an error if not.
🌐
Pythonista Planet
pythonistaplanet.com › python-while-loop-examples
18 Python while Loop Examples and Exercises – Pythonista Planet
February 2, 2023 - The loop will stop its execution once the condition becomes not satisfied. ... In this post, I have added some simple examples of using while loops in Python for various needs. Check out these examples to get a clear idea of how while loops ...
🌐
LinkedIn
linkedin.com › pulse › 25-python-loop-coding-questions-mrityunjay-pathak
25 Python Loop Coding Questions
August 4, 2023 - Explanation: The while loop iterates from 1 to 100, adding each number to the sum_numbers variable. Find all prime numbers between 1 and 50 using nested for and if:
🌐
IncludeHelp
includehelp.com › c-programs › c-looping-aptitude-questions-and-answers.aspx
C Looping (for, while, do while) Aptitude Questions and Answers - IncludeHelp
C programming Looping Aptitude Questions and Answers: In this section you will find C Aptitude Questions and Answers on various looping statements like while, do dhile, for nested looping etc.
🌐
Stack Overflow
stackoverflow.com › questions › tagged › while-loop
Newest 'while-loop' Questions - Stack Overflow
I just learned about accepting user input using scanf() and thought it would be a fun learning experience to make a small "game" that runs in ... ... I was trying to get the last word of the sentence using the .find() method in a loop. My code: sentence = "please write a program which keeps asking the user for words" index = 0 substring = ... ... I have this homework program to calculate mpg. The -1 is the sentinel value which is supposed to skip the questions asking the user for gas and miles when inputted.
🌐
GitHub
github.com › Asabeneh › 30-Days-Of-Python › blob › master › 10_Day_Loops › 10_loops.md
30-Days-Of-Python/10_Day_Loops/10_loops.md at master · Asabeneh/30-Days-Of-Python
The above while loop only prints 0, 1, 2, but when it reaches 3 it stops. Continue: With the continue statement we can skip the current iteration, and continue with the next:
Author   Asabeneh
🌐
BeginwithJava
beginwithjava.com › home › coding › programming questions and exercises : loops
Programming Questions and Exercises : Loops - BeginwithJava
October 7, 2024 - Write a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate. Show the answer.
🌐
ExamTray
examtray.com › c-questions › c-mcq-questions-and-answers-loops-while-do-while-1
C MCQ Questions and Answers on Loops While For Do While 1 | ExamTray
July 17, 2019 - Go through C Theory Notes on Loops before studying questions. ... A) Loops or Repetition block executes a group of statements repeatedly. B) Loop is usually executed as long as a condition is met. ... D) All the above. ... Semicolon after while(condition) is a must. ... B) RABBIT is printed unlimited number of times. ... D) Compiler error. ... D) None of the above. ... If there is no BREAK statement, while loop runs continuously util the computer hangs. BREAK causes the loop to break once and the statement below the while if any will be executed.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-while-loop
Python While Loop - GeeksforGeeks
Explanation: Here, whenever the character is 'e' or 's', the loop skips printing it and continues with the next character. Break statement is used to immediately terminate the loop when a specific condition becomes True.
Published   June 3, 2026