Computer Science, asked by juliya8464, 11 months ago

Write a program to read a string and print the string in pyramid form eg. If user input 'python' then output will be.
P
Py
Pyt
Pyth
Pytho
Python

Answers

Answered by jessicashegin
0

Answer:

str=input("Enter a string:")

for i in range (1,len(str)+1):

   for j in range (1,i+1):

       print(str[j],end=" ")

   print()

     

Explanation:

Similar questions