Con indici di stringhe, c'è un modo per tagliare a fine stringa senza usare len()? Gli indici negativi iniziano dalla fine, ma [-1] omette il carattere finale.Indici di slice stringa di Python - slice to end of string
word = "Help"
word[1:-1] # But I want to grab up to end of string!
word[1:len(word)] # Works but is there anything better?
Questo è coperto nel tutorial Python e in proprio [risposta standard] del SO (http: //stackoverflow.com/questions/509211/good-primer-for-python-slice-notation) per domande a sezioni. – DSM
OK, sentitevi liberi di cancellare se si tratta di spam! – MachineElf