>>>word="amazing" >>>word[:3]+word[3:] Give the output
Answers
Answered by
4
word='amazing'
print(word[:3]+word[3:])
The output of the code is:
amazing
Let us write the index of the characters present in the string.
> word[ : 3] returns the substring from index 0 to 2.
> word[ : 3] = 'ama'
> word [3 : ] returns the substring from index 3 to end (i.e., 6)
> word[3 : ] = 'zing'
Concatenating both string,
> new word = 'amazing'.
So, the output for the given code is - amazing
Similar questions