0
Please where am i not getting it right to get the third character
str = ["hello"] Print(str[2])
17 Réponses
+ 3
Oh dyou tryna tag me?
+ 3
You added square brackets which means python take this as a list not string , hence error
+ 2
str = "hello"
No need of square brackets
(assuming its Python)
+ 1
You don't capitalize the 'p' in print()
+ 1
str = "hello"
print(str[2])
+ 1
It should work
https://code.sololearn.com/cx52pqy7muEQ/?ref=app
+ 1
Don't put squars brakes while defining the string. That will solve your problem. Try like this:
str = "hello"
print(str[2])
+ 1
Maybe, str is an input variable.
Also, don't use inbuilt function name as variable.
string = input()
print(string[2])
+ 1
Manav ROY
Please ho do i get d code u asking for
0
Am not still on it please someone help
0
It still did not work on d practice
0
Manav Roy i have not activate my account so i can't get to u through d message is there any way out or something else u can think off
0
str="hello"
print(str[2])
This is how the code is run it and you will get it done
0
Python is case - sensitive. so, you should use print instead of Print
- 1
H
- 3
It still did not work