Use a for loop to print a box like the one below. Allow the user to specify how wide and how
high the box should be. [Hint: print('*'*10) prints ten asterisks.]
*******************
*******************
*******************
*******************
for i in range(4):
print("*"*10)
This code will use a for
loop to iterate four times, and on each iteration it will print a line of asterisks.
To run this code, you can save it to a file with a .py
extension and run it using the python
command in a terminal or command prompt.
0 Comments