Crear una string
Las strings en Python se pueden crear usando comillas simples o comillas dobles o incluso comillas triples.
# A python program to illustrate slicing in strings x = "Geeks at work" # Prints 3rd character beginning from 0 print (x[2]) # Prints 7th character print (x[6]) # Prints 3rd character from the rear beginning from -1 print (x[-3]) # Length of string is 10 so it is out of bound print (x[15])
Publicación traducida automáticamente
Artículo escrito por GeeksforGeeks-1 y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA