WAP to write INDIA like
I
IN
IND
INDI
INDIA
IN PYTHON
Answers
Answered by
0
Answer:
void main()
{
char a[20];
int i,j,k;
clrscr();
gets(a);
j=strlen(a);
i=0;
while(i<j)
{
for(k=0;k<=i;k++)
{
printf("%c",a[k]);
}
printf("\n");
i++;
}
}
//APPLICABLE FOR ANY STRING
Answered by
2
word = 'INDIA'
print(*[word[:i] for i in range(1, len(word) + 1)], sep = '\n')
Similar questions