one of the most useful videos i have ever seen in KZbin. your are my friend a dame good teacher.
@alphainfinitum34452 жыл бұрын
This is the one video you want to watch. This topic is particularly very confusing on Cisco Networking Academy. Watching this before heading over there is definitely a good idea. You can tell that this guy is a formidable teacher because he is able to cover all the essentials that you need to start writing and reading code in one short video. Thank you very much mate.
@fabulousfabio82282 жыл бұрын
I really love the rigorous way in which you explain things. Thanks
@juliannash8906 жыл бұрын
As someone learning Python, your videos are fantastic :) Keep them coming!
6 жыл бұрын
+Julian Nash thank you!
@sujataroberts30256 жыл бұрын
I tried to learn this from a few sources before I finally understood from watching this. Thank you!
@talmadhoun6 жыл бұрын
You know your stuff and you explain it very well. You're a great teacher. Thank you!
@lexinexiai3 жыл бұрын
Great content, rare content
@fuanka17246 жыл бұрын
Thanks for making these awesome videos, you are a great teacher! :)
6 жыл бұрын
Glad you like them!
@AlexanderLebedev_sortafreel7 жыл бұрын
Amazingly useful video!
@adeyeyeayomide44426 жыл бұрын
waooh! This is concise, succinct and informative
@Phantastischphil4 жыл бұрын
Thank you. I was searching for the code behind exceptions while using SOLO LEARN. Thank you for explaining that they are objects and how to construct and tailor specific instances!
@springinfialta1067 жыл бұрын
It would be helpful to have a talk describing multiple exceptions within a block. Some programmers would say that each block should just do one very specific thing and would only require one try...except. However, sometimes you are doing a few very related things such as working with files and each of those steps might throw an exception. You don't necessarily want to chop up that piece of code into a bunch of separate functions. Even in your Factorial example. You could have multiple checks: 1) Is the type correct? 2) Is the passed in number an integer? 3) Is the passed in number >= 0 How are those tests integrated together? I've seen things like this which seem over the top: try code except exception else: try code except exception else: try etc Is there a better way?
7 жыл бұрын
The details of course depend on the situation and the programmer's sense of aesthetics. But as a general thought: If you have multiple checks, you can generally do them sequentially, one after another; so a deeply nested structure (which is awful) like your example is seldom necessary. And when it comes to input validation, type hints might also come in handy (kzbin.info/www/bejne/qKrXgZKsfs-tm6c). But at the end of the day: If you need to check a lot of things, you'll inevitably end up with a lot of boilerplate code!
@Usammityduzntafraidofanythin5 жыл бұрын
There's also if else, which gives another layer. Taken from channel SentDex
@jyvben1520 Жыл бұрын
have functions that each test 1 condition, with specific try/except + raise the_error("message") and the main code has a generic try/except Exception as e, with the many functions in the try block. try: test_is_num(a_value) test_is_int(a_value) test_is_pos(a_value) # here we can do the work or in the else block except Exception as e: print("Error: bad input", a_value) print(e) # optional else: print("good input, we can work with this") finally: pass
@m.preacher28294 жыл бұрын
very clear explanation,thanks
@cmdlp41787 жыл бұрын
You can catch SyntaxErrors when importing or running code with eval/exec.
7 жыл бұрын
+cmdLP that's a good point, yes.
@denispmaciel6 жыл бұрын
Thank you!
@FitLife67676 жыл бұрын
Yeah this one was very useful... It seems it was made specifically to address my issue...Thank you very much!
@davidreynolds96497 жыл бұрын
What is the document/environment you are using to display this?
7 жыл бұрын
It's a Jupyter Notebook, which is basically an IPython terminal in a webbrowser. Very useful!
@davidreynolds96497 жыл бұрын
thnx .... looks very cool :)
@gabrielkomanderzapata31895 жыл бұрын
Nice video many thanks
@amateruss6 жыл бұрын
WTF I thought your cam was a random picture of a dude on a beach having a vacation until I pressed the play button.
@ELHAUKEZ5 жыл бұрын
def riddle(): try: return 1 finally: return 2
@pizzaboiiiiiiiiiiiiiiiiiii18823 жыл бұрын
keep going dude, way to hawaii
@vaibhavashrivastava93105 жыл бұрын
"i have a data frame with columns ID and date, If date is invalid how my python program can tell me which ID indexed with invalid date"
5 жыл бұрын
You can use the `isnull()` method. So say that your DataFrame is called `df` and your column is called `date`, then you can get the (indexes of) invalid dates with `df.date.isnull()`.
@schogaia4 жыл бұрын
What is the benefit of using try: else:? I just put everything in the try block. I would appreciate if someone could explain this to me. Thank you
4 жыл бұрын
If you include too much code in the try block, it becomes difficult to know where Exceptions come from. So it's good practice to include as little code as possible in the try block.
@schogaia4 жыл бұрын
@ thank you for the answer and thank you for great videos
@antongeorgiev17045 жыл бұрын
Very nice series, thank you! fyi, saying there is no logic behind 0! = 1, just def, hurts my mathematician's hearth ;(