Python standard library: str.maketrans and str.translate

preview_player
Показать описание


Subscribe to this channel, as I try to go through all of the Python standard library!
Рекомендации по теме
Комментарии
Автор

Thanks, very short and understandable

arjungoud
Автор

Brings me back to my school days when there was something funny in a lecture or material, and when the teacher used to say it, we'd all giggle mischievously, trying not to get caught.

satymshrma
Автор

Switched my accounts (from my video making account) to make sure to come back and give you a like and comment! Great content and super clear explanation

davescott
Автор

This video is a great explanation for the maketrans() and translate() functions. Thank you, sir.

randomstuff
Автор

Amazing video. You just summed up pages of text in a few minutes.

expansivegymnast
Автор

perfect. I was part of those offensive usenets in the past. thanks for the nostalgia.

pavelow
Автор

Дякую, мені дуже допомогло зрозуміти як працюють ці методи!

noname
Автор

Hey! Thanks for this video, really helped me out
keep doing a good job

sebastienlorentz
Автор

Just a little catch here with str.maketrans which was not stated in help(str.maketrans), removal is done before replace!
>>> s
'abcdeabcde'
>>> d = str.maketrans('ab', 'xy', 'b')
>>> d
{97: 120, 98: None}
>>> s.translate(d)
'xcdexcde'
>>>

leelavg
Автор

Great video, but I have a question. Why do we use str.maketrans()? Where does the str. comes from? Is it a subset of the str() function or is it some sort of empty variable?

NOVAsteamed
Автор

Which editor are you using and is there a linux equivalent?

WeedMIC