-2
val = int(input())
for x in range (0, val):
    print('*',end='')

I want to get the answer input is 5 when

*****
*****
*****
*****
*****

How to do this???

Mechanic Pig
  • 6,756
  • 3
  • 10
  • 31

1 Answers1

0

Python is a bit weird, you can actually multiply your string by a number, and it will print the string that many times.

val = int(input())
for x in range (0, val):
    print('*' * val)
dotJSON
  • 30
  • 4