Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python code?
>>> str1 = ‘hello’
>>> str2 = ‘,’
>>> str3 = ‘world’
>>> str1[-1:]

What will be the output of the following Python code?
>>> str1 = ‘hello’
>>> str2 = ‘,’
>>> str3 = ‘world’
>>> str1[-1:]
a) olleh
b) hello
c) h
d) o

Answer: d
Explanation: -1 corresponds to the last index.

Join The Discussion