0
one new question
Hey again , thank you for everyone i have now another question what i cant understand somthing , and i want some body answer the question and try to explain for me how he did it sa i understand . i cant understand very good Lists Remember, strings can be indexed like lists. Write a program that takes an input string and outputs the 3rd character of the string. Sample Input Hello Sample Output l ------ Thank u again
4 Answers
+ 2
string= input()
#string[position]
print(string[2])
+ 4
You can use index ([]) to access any character in a String.
Syntax: str[index]
In your exercise, you have to take a String from the user and print the third character.
Remember that indices start from zero.
someText = input()
print(someText[2])
or
print(input()[2])
+ 2
Yes i understand and this working good ,
thank you very much
0
For the future:
1. Please always mention the programming language you're asking about in the tags.
2. Please use meaningful titles.
https://www.sololearn.com/discuss/333866/?ref=app
https://code.sololearn.com/W3uiji9X28C1/?ref=app