Exercises Python logo
Exercises Python
Course Practice Editor Get started free
  1. Python course
  2. Flow controls: Loops
  3. Using the while statement
26 Flow controls: Loops
Fundamentals concepts
  • The while loop
  • The for loop and range
  • Looping over strings with for
  • Counters and accumulators
  • break, continue and while True
  • Nested loops
  • Common mistakes with loops
Practice exercises
  • Char alphabet
  • Product of a number
  • Multiplication table
  • Prime number
  • Descending odd numbers
  • Return change
  • Product of prime factors
  • Using the while statement
  • While loop with validated input
  • Repeated number
  • Convert integer to binary and hexadecimal
  • Range of numbers
  • Multiples numbers
  • Hexadecimal table from 0 to 255
  • Access control
  • Infinite number sum
  • Infinite divisions
  • Infinite multiplication tables
  • Digits in a number
Flow controls: Loops · 15 / 26 Exercise Easy

Using the while statement

Objective

Create a Python program that requests a number (x) and displays the result of multiplying that number by 10. The program should repeat until the user enters 0.

Input
5
4
6
0
Output
50
40
60

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise
← PreviousProduct of prime factors Next →While loop with validated input
Exercises Python logo
Exercises Python

Learn Python by solving practical exercises, free and right in your browser.

Get it on Google Play

Learn

  • Home
  • Course
  • Practice
  • Editor

More

  • Features
  • Contact

Account

  • Log in
  • Sign up

Legal

  • Privacy policy
  • Cookies policy
  • Terms and conditions
  • Cookie settings
  • Sitemap

© 2026. Made with 💙 by Jaracoder.

English
  • Español

We use necessary cookies to keep your session. With your consent we also use cookies for advertising and analytics, which keep the course free and help us improve it. Cookies policy