Exercises Python logo
Exercises Python
Course Practice Editor Get started free
  1. Python course
  2. Flow controls: Loops
  3. Repeated number
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 · 17 / 26 Exercise Easy

Repeated number

Objective

Create a Python program that requests a number (x) and a quantity (y) from the user. Then, display that number as many times as the specified quantity (y).

Input
5
13
Output
5555555555555

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

Start exercise
← PreviousWhile loop with validated input Next →Convert integer to binary and hexadecimal
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