Exercise
Quadrilateral Dimensions
Objective
Develop a Python program to prompt the user for a number and then display a rectangle 3 columns wide and 5 rows tall using that digit. For example:
Enter a digit: 3
333
3 3
3 3
3 3
333
Example Python Exercise
Show Python Code
# Prompt the user to enter a digit
digit = input("Enter a digit: ")
# Display the rectangle using the entered digit
print(digit * 3)
print(digit + " " + digit)
print(digit + " " + digit)
print(digit + " " + digit)
print(digit * 3)
Output
Enter a digit: 3
333
3 3
3 3
3 3
333
Share this Python Exercise
Explore our set of Python Programming Exercises! Specifically designed for beginners, these exercises will help you develop a solid understanding of the basics of Python. From variables and data types to control structures and simple functions, each exercise is crafted to challenge you incrementally as you build confidence in coding in Python.
In this exercise, you will develop a Python program that asks the user for a temperature in Celsius and converts it to both Kelvin and Fahrenheit...
In this exercise, you will develop a Python program to output "Hello" on the screen, followed by your name on a separate line. This exercise is perfect for pra...
In this exercise, you will develop a Python program to print the result of adding 12 and 13 on the screen. This exercise is perfect for practicing basic arithm...
In this exercise, you will develop a Python program to display the result of dividing 24 by 5 on the screen. This exercise is perfect for practicing basic arit...
In this exercise, you will develop a Python program to calculate and display the results of several mathematical operations. You will work with expressions such as 1 + 3 ...
In this exercise, you will develop a Python script to calculate and display the product of two numbers entered by the user. This task introduces you to handlin...