0

What is the correction of this in Python ?

name="yasser" name1="maoz" name2="yhya" print(name.[3]) print(name1.index("a")) print(name2.[5])

4th Jun 2020, 7:30 PM
y66s6
y66s6 - avatar
2 Answers
+ 1
print(name[3]), not name.[3] print(name2[5]), not name2.[5] indexing by square brackets is not a method, it is a special operation that access an iterable by its elements' indices.
4th Jun 2020, 7:36 PM
Ali Abdelhady
Ali Abdelhady - avatar