How to get the first character of the second string in a list with Python

2 Answers

0 votes
lst = ["java", "python", "c", "c++"]

print(lst[1][0]);
  
  
  
'''
run:
  
p

'''	

 



answered Aug 23, 2022 by avibootz
0 votes
lst = ["java", "python", "c", "c++"]

print(lst[1][:1]);
  
  
  
'''
run:
  
p

'''	
 
 
 

 



answered Aug 23, 2022 by avibootz
...