Get answer of your all questions and doubts! ➤
Question
Given str1 = “Hello”, what will be the values of:
(a) str1[0]
(b) str1[1]
(c) str1[-5]
(d) str1[-4]
(e) str1[5]
[Computer Science Class – 11 Sumita Arora solutions. Chapter 6 – Data Handling.]
Answer
(a) Η
(b) e
(c) H
(d) e
(e) IndexError: string index out of range
Related Questions:
- What are three internal key-attributes of a value-variable in Python? Explain with example.
- What will the result given by the following? (a) type (6+3) (b) type (6-3) (c) type (6*3) (d) type (6/3) (e) type (6//3) (f) type (6%3)
- How are these numbers different from one another? 33, 33.0, 33j, 33+j
- The complex numbers have two parts: real and imaginary. In which data type are real and imaginary parts represented?
- Ask or look other questions and answers.