@valoro/

longitud_cadena_1

Python

https://altocodigo.blogspot.com/2018/08/longitud-de-una-cadena-en-python.html

fork
loading
Files
  • main.py

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.5201383087186462","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZGVmIGxvbmdpdHVkQ2FkZW5hKHgpOgogIGNvbnRhZG9yPTAKICBmb3IgaSBpbiB4OgogICAgY29udGFkb3IrPTEKICByZXR1cm4gY29udGFkb3IKZGVmIG5vbWJyZVByb3Bpbyh4KToKICB5PXgubG93ZXIoKQogIHJldHVybiB5WzBdLnVwcGVyKCkreVsxOl0KeD1pbnB1dCgnSW5kaXF1ZSB1bmEgcGFsYWJyYScpIG9yICdtQWRJZCcKcHJpbnQobm9tYnJlUHJvcGlvKHgpLCd0aWVuZScsbG9uZ2l0dWRDYWRlbmEoeCksJ2NhcmFjdGVyZXMuJykg"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
def longitudCadena(x):
  contador=0
  for i in x:
    contador+=1
  return contador
def nombrePropio(x):
  y=x.lower()
  return y[0].upper()+y[1:]
x=input('Indique una palabra') or 'mAdId'
print(nombrePropio(x),'tiene',longitudCadena(x),'caracteres.')