-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
  • 1,949
  • 1
  • 4
  • 17

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)
jaycelinux
  • 18
  • 2