For beginners (especially when learning to fix problems yourself) doing 2 lstrips would also be sufficient, 1st strips "w" and 2nd strips "." Like print((link.lstrip("w")).lstrip(".")) I know it looks like a nightmare, but having students who regularly try fixing problems themselves makes one immune to judging on looks alone.
@heavy0119Сағат бұрын
Of course Python already has a function for it
@LastSparkСағат бұрын
what is that color scheme
@kushyadav54703 сағат бұрын
And I thought using Ltrim 💀
@Szirox_5 сағат бұрын
app name?
@JusticeNDOU6 сағат бұрын
so you do not have to turn into a list again as ,keys() is a list
@AMD-BL4ZE6 сағат бұрын
I mean the concept is good but I wouldn't die if it takes 0.3 seconds instead of 0.2 seconds to run the code
@Jolbulka7 сағат бұрын
if you have a problem with it, AI will surely take your job, and I'm not even using python lately
@FlosBlog9 сағат бұрын
Did you just resolve the coding prompt "make a calculator?
@hlubradio231810 сағат бұрын
Let me try it
@it_is_random11 сағат бұрын
python rule 34: if it exists there is a function for it.
@en804213 сағат бұрын
but why is this though? Scope of the variable is decided at compile time. It doesn't try to resolve the scope every iteration, lol. Check bytecode, it should be LOAD_GLOBAL instead of LOAD_FAST, so it's known at compile time. So LOAD_FAST is faster than LOAD_GLOBAL in your example, though I'm not sure why, both them look like to me as a simple lookup in a dictionary. Btw, I also experimented with this a couple of times and I didn't see a performance gain.
@jasonnn1214 сағат бұрын
uses this syntax a lot when I code in JavaScript
@NoobStuff200716 сағат бұрын
Thanks man, this was very helpful.
@scottclowe19 сағат бұрын
This is illegible though. Shorter code is not always better.
@hlubradio231820 сағат бұрын
No no stinking C switch statement
@hlubradio231820 сағат бұрын
Never heard of it bit similar to C switch statement which was very annoying
@kobekapoor22 сағат бұрын
Can you do a video on how you test performance like that?
@paulschwartz527723 сағат бұрын
Maybe you could answer a question for me. I run into these statements %matplotlib widget import matplotlib.pyplot as plt The % is new to me, whats going on here? Have you produced a video on this?
@soulspirit8687Күн бұрын
Fisher and Wagner did not invent the bicycle, Levinstein invented an algorithm, it is up to you on how you would implement it
@blacktimes9662Күн бұрын
Is list comprehension on the map function more efficient? (Asking the pro > trying it out myself)
@ajflinkКүн бұрын
I have created some very optimized solutions in Python that I use regularly as a solo programmer that would probably give others a heartattack.
@blacktimes9662Күн бұрын
map-function >>>
@blacktimes9662Күн бұрын
link = link.split("www.")[1] 👁👄👁
@SuperMilhauzКүн бұрын
Yeah, where are you going to use it? All these tutorials that are usefull af.
@papa-peteКүн бұрын
Why would you sort a presorted input?
@MonirulIslam-ud3pxКүн бұрын
Whats the font name and theme name?
@RichardChanouКүн бұрын
This is very fruitful. However, I recommend that you slow down your speed. You were too fast in your speech
@user-xy6tv9dq9cКүн бұрын
amazing trick
@danyar25Күн бұрын
This works only if ANY string is accepted as “Name”. The ternary operator could work when there further checks needed, i.e. a certain min length. Then 2 lines are needed, or am I wrong?
@shardatorКүн бұрын
Another alternative: implement caching in python interpreter? This should not be an issue.
@tcheuffayvan6422Күн бұрын
What about link.replace(‘www.’, ‘’) ?
@billclinton4913Күн бұрын
i have an idea. learn C
@Ihat3my1if32 күн бұрын
Video style reminds me of a certain ship that is on fire.
while True: this_or_that = input("Do this or that? ") if "this" in this_or_that.lower() and "that" not in this_or_that.lower(): do_this() elif "that" in this_or_that.lower() and "this" not in this_or_that.lower(): do_that() elif "this" and "that" in this_or_that.lower(): print("You've got to pick one!" ") else: print("Invalid input! "
@freds_chess2 күн бұрын
okay, fine, i guess you're right 😂😂😂
@coltengibbs54042 күн бұрын
What’s wrong with print(1+2)? Or print(x+y)? Genuinely asking, I’m new to programming.
@artwork-studios2 күн бұрын
Maybe a minecraft clone but it hard af
@colly60222 күн бұрын
isnt this the diff algorithm too?
@kjartannn2 күн бұрын
I don't like these videos cause they aren't teaching you anything. To be a good programmer you have to to be a good problem solver. All this does is teach a single function you may or may not need, that you could've found while searching for it in the docs anyway.
@EmmettReaville3 күн бұрын
what website do you use?
@integrantedavidanoturna3 күн бұрын
Djikstra was a legend, that's a really cool algorithm
@ayushsrivastava46923 күн бұрын
me with my string slicing in the corner
@diro93113 күн бұрын
What's len?
@diro93113 күн бұрын
Nvm I get is like length of the word like numbers of letters ah I see
@GloryGospel463 күн бұрын
I am curious. The code creates an array with the name mylist, but I can't find the location where you use that array. I feel this array exists and operates but has no function
@Molhamkn-GamesXEdits3 күн бұрын
How do I make it de acending?
@Molhamkn-GamesXEdits3 күн бұрын
Wait I thought we had to do name == user_input or ‘N/A’
Пікірлер
For beginners (especially when learning to fix problems yourself) doing 2 lstrips would also be sufficient, 1st strips "w" and 2nd strips "." Like print((link.lstrip("w")).lstrip(".")) I know it looks like a nightmare, but having students who regularly try fixing problems themselves makes one immune to judging on looks alone.
Of course Python already has a function for it
what is that color scheme
And I thought using Ltrim 💀
app name?
so you do not have to turn into a list again as ,keys() is a list
I mean the concept is good but I wouldn't die if it takes 0.3 seconds instead of 0.2 seconds to run the code
if you have a problem with it, AI will surely take your job, and I'm not even using python lately
Did you just resolve the coding prompt "make a calculator?
Let me try it
python rule 34: if it exists there is a function for it.
but why is this though? Scope of the variable is decided at compile time. It doesn't try to resolve the scope every iteration, lol. Check bytecode, it should be LOAD_GLOBAL instead of LOAD_FAST, so it's known at compile time. So LOAD_FAST is faster than LOAD_GLOBAL in your example, though I'm not sure why, both them look like to me as a simple lookup in a dictionary. Btw, I also experimented with this a couple of times and I didn't see a performance gain.
uses this syntax a lot when I code in JavaScript
Thanks man, this was very helpful.
This is illegible though. Shorter code is not always better.
No no stinking C switch statement
Never heard of it bit similar to C switch statement which was very annoying
Can you do a video on how you test performance like that?
Maybe you could answer a question for me. I run into these statements %matplotlib widget import matplotlib.pyplot as plt The % is new to me, whats going on here? Have you produced a video on this?
Fisher and Wagner did not invent the bicycle, Levinstein invented an algorithm, it is up to you on how you would implement it
Is list comprehension on the map function more efficient? (Asking the pro > trying it out myself)
I have created some very optimized solutions in Python that I use regularly as a solo programmer that would probably give others a heartattack.
map-function >>>
link = link.split("www.")[1] 👁👄👁
Yeah, where are you going to use it? All these tutorials that are usefull af.
Why would you sort a presorted input?
Whats the font name and theme name?
This is very fruitful. However, I recommend that you slow down your speed. You were too fast in your speech
amazing trick
This works only if ANY string is accepted as “Name”. The ternary operator could work when there further checks needed, i.e. a certain min length. Then 2 lines are needed, or am I wrong?
Another alternative: implement caching in python interpreter? This should not be an issue.
What about link.replace(‘www.’, ‘’) ?
i have an idea. learn C
Video style reminds me of a certain ship that is on fire.
Which IDE is this?
Simpler one-liner: sorted(set(old), key=old.index)
So a list in python isnt a list?
while True: this_or_that = input("Do this or that? ") if "this" in this_or_that.lower() and "that" not in this_or_that.lower(): do_this() elif "that" in this_or_that.lower() and "this" not in this_or_that.lower(): do_that() elif "this" and "that" in this_or_that.lower(): print("You've got to pick one!" ") else: print("Invalid input! "
okay, fine, i guess you're right 😂😂😂
What’s wrong with print(1+2)? Or print(x+y)? Genuinely asking, I’m new to programming.
Maybe a minecraft clone but it hard af
isnt this the diff algorithm too?
I don't like these videos cause they aren't teaching you anything. To be a good programmer you have to to be a good problem solver. All this does is teach a single function you may or may not need, that you could've found while searching for it in the docs anyway.
what website do you use?
Djikstra was a legend, that's a really cool algorithm
me with my string slicing in the corner
What's len?
Nvm I get is like length of the word like numbers of letters ah I see
I am curious. The code creates an array with the name mylist, but I can't find the location where you use that array. I feel this array exists and operates but has no function
How do I make it de acending?
Wait I thought we had to do name == user_input or ‘N/A’