0
Print("hello ,world!"[7:13][2])
About index
9 Antworten
+ 1
What about index?
Q&A is for asking programming related questions. What is your question? And tag the relevant programming language.
+ 1
Python is case-sensitive. The function name is print(). It is not Print().
0
question=Print("hello ,world!"[7:13][2])
Python
0
READ:
What is the ⭐️QUESTION ⭐️?
0
question=Print("hello ,world!"[7:13][2])
Python
0
This is not a question; this is code that produces an error.
Q&A is not a quiz.
What help do you need?
0
Why
0
Why the code give error
0
Ramya.S Ramya.S ,
make sure that you have learned and understand what this code should do (using index notation to get data from the string and slicing parts of a string using start and end index). otherwise it could be helpful if you can repeat some lessons.
the given code has some issues:
> print(...) has to be in lower case. (as already mentioned by Brian )
> assigning the result of a print(...) statement to a variable does not make much sence, since the stored value is `None'
what is the code doing: (i suppose that the code should output a result)
> the given string will be sliced from index 7 as a start, upto index 13 as the end, but not including it.
> from this result the character with index 2 should be printed.