name = input("What's your name?? ")
print(10 * name )
prints the name 10 times in a row but if I want the name to be printed in columns 10 times how should I do thanks
name = input("What's your name?? ")
print(10 * name )
prints the name 10 times in a row but if I want the name to be printed in columns 10 times how should I do thanks
You can simply append a newline character at the end of the name:
name = input("What's your name??")
print(10 * (name + '\n'))
\n is the newline character - anything printed after it will go to the next line.
You can print 10 times your name, using '\n' (the new line character) as a separator:
name = input("What's your name??")
print(*(name for i in range(10)), sep='\n')
You could also use itertools.repeat:
from itertools import repeat
name = input("What's your name??")
print(*repeat(name, 10), sep='\n')
name = input("What's your name?? ")
print(10 * (name+'\n'))
you can use from the above code it is the beautiful character of python, but I suggest you to use of:
name = input("What's your name?? ")
for i in range(10):
print(name)
that will be the real coder's work