Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python print string name in pattern

j="ramkumar"
for i in range(len(j)):
    for g in range(0,i+1):
        print(j[g],end=' ')
    print('')
# end='' meaning (print the next answer , near the previous answer in same line)
#answer 1 2 3 4 5 6 like this in same row or same line(in horizontal)



name="ramkumar"
for i in range(len(name)) :
    print(name[0:i+1])
 
PREVIOUS NEXT
Tagged: #python #print #string #pattern
ADD COMMENT
Topic
Name
2+8 =