Don't make this mistake with Strings in Python!

preview_player
Показать описание
Don't forget that Strings are immutable and make this mistake!

Get my Free NumPy Handbook:

📓 ML Notebooks available on Patreon:

If you enjoyed this video, please subscribe to the channel:

~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~

#Python #shorts
Рекомендации по теме
Комментарии
Автор

I'm glad he's posting good information for rookies instead of misinformation for professionals

k_gold
Автор

Wow i never knew how immutables work! Thanks

vinpepper
Автор

I learnt immutability after watching this.Thanks for the road way to the content.keep posting dude.

eswarreddy
Автор

You're awesome, keep updating 👍✨

yashshrivastava
Автор

This is useful, as people often forget that when you reference a string in a built-in python function, It will return the modified string, without modifying the variable.

declan_youtube
Автор

Thanks man , that was so quick and informative 🤩😍

ajinkyaadhotre
Автор

Small things like these make a lot of difference. Keep sharing 👍

thetruereality
Автор

Quick but solid <3 let's more coming

djangodeveloper
Автор

Hi, what theme extension for vscode are you using?

getoar
Автор

or you can just put everything in a single line like this: my_string = " xxxPythonyyy

fortznite
Автор

I found out a week ago that strings have really usefull methods. The one I was most amazed about was the str.center() method. All ready knew the most popular ones, so really glad I learned some more

knut-olaihelgesen
Автор

Is there a way to change python string into actual code (without the ' ' items) to act as a variable rather than a string?

globalfinancetrading
Автор

What shortcut did you use to add that code at the beginning of the statements?

tommys
Автор

How did you made those variables with a shortcut?

devamrh
Автор

You get a sub for that. I wish more people put out practical shorts like this for us noobs.

countofst.germain
Автор

What would be the best place for a noob who only has basic terminal experience in Linux (Ubuntu)

daleputnam
Автор

It would be cool to have a ".=" operator for applying the method following the operator to the (immutable) object and rewriting the variable with the result
For mutables it would still look the same:
"lst.shuffle()"
But for immutables instead of writing
"mystr = mystr.strip()"
We could have
"mystr.= strip()"
Though, if the method for mutables also return the result, it could be alternatively written as
"lst.= shuffle()"
(Not sure if list.shuffle returns the result, it's only for demonstrative purposes; also it wouldn't have any difference)
Makes it less prone to errors(due to less copying and pasting of the name)
Yes, it does look less readable, probably because we are not used to it, but looks like a great idea. Although this only applies to strings and tuples and (maybe) frozen dataclasses
The old way of writing would still be here, of course

JordHaj
Автор

Are you using vscode? How did you modify your terminal like that?

gadooze
Автор

Any thoughts on python using pipes like in R?

Septumsempra
Автор

Can we use the order of srring like we all know if there is a sring the value of first character is 0 when we count fron left to right. And also when we count a string from right to left the value of first character in right is -1 . Can we write a code to dump the first and last character and print out the remaining string characters. I dont know what you are think but i am just start to learn python . So is that method is correct or wrong ?

Pixel_Recap