“sznur wykończenia Python do długości” Kod odpowiedzi

sznur wykończenia Python do długości

mystr="I am too long I should only be 10 characters.";
mystr = mystr[:10]
Friendly Hawk

Przycinanie przestrzeni w Pythonie sznurkowym

a = "      yo!      "
b = a.strip() # this will remove the white spaces that are leading and trailing
Super Stoat

Przytnij ciąg do maksymalnej długości Python

length=75
info="sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trimsting you want to trimsting you want to trimsting you want to trimsting you want to trimsting you want to trimsting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trim sting you want to trimsting you want to trim sting you want to trim sting you want to trim sting you want to trim"
info = (data[:length] + '..') if len(data) > length else data
Yog

Odpowiedzi podobne do “sznur wykończenia Python do długości”

Pytania podobne do “sznur wykończenia Python do długości”

Więcej pokrewnych odpowiedzi na “sznur wykończenia Python do długości” w Python

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu