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

2 Answers

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

print(lst[0][0]);
  
  
  
'''
run:
  
j

'''	
 
 
 

 



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

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

'''	

 



answered Aug 23, 2022 by avibootz
...