“Python Trip String к длине” Ответ

Python Trip String к длине

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

Тяжелые пространства в струнном питоне

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

Trip String до максимальной длины 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

Ответы похожие на “Python Trip String к длине”

Вопросы похожие на “Python Trip String к длине”

Больше похожих ответов на “Python Trip String к длине” по Python

Смотреть популярные ответы по языку

Смотреть другие языки программирования