English, asked by Princedynamic5738, 1 year ago

What will be output of below text. info1 = 'Infinity' info1.find('a')

Answers

Answered by topanswers
2

Given:

info1 = 'Infinity'

info1.find('a')

To find:

The output.

Solution:

The find(character) returns the position of the character in the text.

Here,

The given text is Infinity and the character to be found is 'a'

There is no 'a' in this text.

If the character that is being searched for is not found, the function returns -1.

Hence, the program outputs -1.

That is, the character is not found.

Answered by Sidyandex
0

The find (character) returns the position of the character in the text.  

Here,  The text given  is Infinity and the character which has to be found is 'a' since There is no 'a' in this text.  

If the character is not found, the function returns -1.

Hence, the output of the program is  -1.  

Similar questions