#63 Python Tutorial for Beginners | Exception Handling
HTML-код
- Опубликовано: 14 окт 2024
- Check out our courses:
Spring Boot and Microservices Live Course : go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Complete Java Developer Course Batch-3: go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Enterprise Java Spring Microservices: go.telusko.com...
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com...
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
Spring: go.telusko.com...
Java:- go.telusko.com...
Java Spring:- go.telusko.com...
Java For Programmers:- go.telusko.com...
Python : go.telusko.com...
Git : go.telusko.com...
Docker : go.telusko.com...
For More Queries WhatsApp or Call on : +919008963671
website : courses.telusk...
Instagram : / navinreddyofficial
Linkedin : / navinreddy20
TELUSKO Android App : bit.ly/TeluskoApp
Discord : / discord
Python Tutorial to learn Python programming with examples
Complete Python Tutorial for Beginners Playlist : • #1 Python Tutorial for...
Python Tutorial in Hindi : • #1 Python Tutorial | I...
Github :- github.com/nav...
Java and Spring Framework For beginners with Spring Boot : - bit.ly/3LDMj8D
Java Tutorial for Beginners (2023) :- bit.ly/3yARVbN
Subscribe to our other channel:
Navin Reddy : / @navinreddy
Telusko Hindi :
/ @teluskohindi
Sir your teaching style is innovative and the tidbits that you say in-between is what makes you a great teacher.
I've been taught by many teachers and I can say the level at which teach, for which other teachers get paid a lot, but you deliver all this for free is commendable.
Thank you very much Sir for rejuvenating my passion for Python.
mamulu racha kadu, I was almost ready to pay for python classes and i found this channel. THE BEST channel to learn coding.
I literally learned the entire python language through your videos. Tysm for great videos and simplified explanation
@@etcetc3800 what r u doing here ....! Then
Bullshit
@@etcetc3800 bruh
So I am slowly approaching the end of your Python course, Sir, and I have to thank you. I have started just a few weeks ago as a total beginner, and because of you, I can now write a simple applications, and (and that's most important) I can think as a programmer which made learning other languages a lot easier for me. Thank you, Sir Navin Reddy
Telusko = 1
Navin_Reddy_Sir = 100
try:
print("Telusko + Navin_Reddy_Sir")
except:
print("you don't have any errors, Sir.")
finally:
print("you are still the best")
High IQ comment
Itna to college wale bhi nahi karate jitna navin ji samjha dete h ❣️❣️❣️
It was always confusing for me about the error handling. You made it crystal clear today. I like your simplicity in teaching complex concepts.
Mr Perfect = Navin Reddy Sir
Python=Navin reddy sir💕
Great explanation.
Also I like all your catch phrases. Eg, "Hold on" and "For those with Java, C++ background will be familiar with this" and "You might be wondering" and "What would happen if" and "Oh thats weird, what if i do this.."
"The general doctor" 👍
Nicely put. My compliments!
Thank you very much for this tutorial! It was that part of coding what I have never understood exactly, until I've seen your video!
A good class that can easily confuse if one is not careful.....otherwise you are Mr Good in this field, as a starter, I feel challenged to when I will be there. Again thanks to my classmates because the comments we write here are also resourceful by far when I read, understand and
run them, I get informed of extra things. Big up guys.
You really have a knack for teaching ...brilliant
I have started loving python because of your teaching sir hats off to you🙏🙏🙏🙏🙏
Sir you are great with thier easy explanation.i learn most of the thing in python for your channel .it is very good and easy to understand.
Thank you sir...
You're a great instructor, thanks for sharing these concepts in a way that beginners can actually understand :)
very crisp explanation. Small and simple examples which I was easy to get an understanding, i.e the fridge concept= open a door take a bottle then close it.
The best video for Exception handling in RUclips. Nailed it sir.
a=5
b=2
try:
print("resource open")
print(a/b)
k=int(input("enter a number"))
print(k)
except ZeroDivisionError as e:
print("Hey, you cannot divide a number by zero",e)
except ValueError as e:
print("Invalid input", e)
except Exception as e:
print('something went wrong...',e)
finally:
print('resource closed')
u made easier sir better than my teachers or frnds thanks a lot
Navin your videos are amazing.
Navin, please specify else block as well. i.e, try block for checking any error, except block will handle the error, else block will execute if there is no error, and finally block will excecute regardless the result of try and except block.
Nice videos Navin sir
These are very helpful to me. Thank you a lot for your hard work.
Navin Sir I am just a 15-year-old kid interested in programming. In school, we are taught JAVA language. I know the basics but still, you teach so well that in my 10th grade currently sitting at home during the lockdown I stay awake until 11:00 pm after completing the studies just because u teach with so many interesting real-life examples. So just love the way u teach. I have watched 63 videos in 8 days. I am really enjoying. Thank u!!!!!!!!
@Aanshumaan Shrijai VII C Roll No. 37 Thats Good!! I was told one thing you know by one of my connections on LinkedIn just to motivate you here is the thing:
Udit Rathod
You should explore never stop exploring ... just keep in mind you have to be Dora the explorer because that's what I do.
That's the man UDIT RATHOD who told me pretty inspiring things!! If possible connect with me on LinkedIn we can discuss a lot of things!! You can also get ideas from me we can exchange challenges lot more.
@Aanshumaan Shrijai VII C Roll No. 37 Then how can we be in contact?
i wish i had a teacher like u in my school!!!!!!!!!!!!
You’re the best teacher in the world. Tutors in Udemy should take note from this lovely man.
Hi Navin,
you throw in a lot motivational points and give us a very clear picture of what exceptions are, why you might need them and you provide basic usage of the python 'try'-'except' construct. Very well done! Now I feel fully prepared to try out some examples myself ( which I have already ...) as well as explore the nitty gritty details in the python documentation for specific applications and problems. WELL EXPLAINED, WELL DONE and THANK YOU!!
Hello Sir your way of teaching and the presentation is amazing 👍👍
Can I like this a million times? Thank you Telusko!
The most intriguing and easy going class so far
You are a very good teacher, the way you explain with simplicity is awesome.
Sir...thank you for your python beginners tutorials...sir are you going to upload videos on python frameworks and advanced libraries... Like sckit learn numpy opencv etc..? please let me know sir...
I m learning python 1st time from your Chanel .. it’s really helpful ..thank you sir
Sir your videos clearly shows you interest in learning new techs and the deep knowledge you have
Everytime I view your tutorials I just make sure make sure to click that big fat like button and I move to watch that video you're simply awesome it's just a crystal clear thankyou sir
Great teaching style sir all doubts are clear👌👌👍👍👍👍🎂
i was struglling with this topic from long time. u made it just like clear water. thank u
Phenomenal explanation... This guy doesn't throw unhandled error.
A good teacher doesn't need a whole day for any good concept simply this much time is enough
Thank you sir 👍
u r great .. i got ur explanation from a first time without repeat the video 😍 thank u so much ❤️
sir ,you have versatility in the teaching and i am lucky to see this channel
It's always good practice to write specific exception which we aware. If we don't know what kind of error will occur then Parent Exception.. Taught by Naveen Automation Labs.. same theory by Naveen Reddy.. Both were awesome in teaching.. 👍👍👍
You have cleared that concept of try and catch in a best possible way. I was lot of confused in that exception topic but you have cleared the every thing. hats off to you sir. And your way of teaching is absolutely excellent.
Sir 🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻The way you are teaching 👌🏼👌🏼👌🏼👌🏼NAA buthoo na bavishyath🤝🤝🤝🤝✊✊
This is how you teach. keep it basic/simple. Thanks, great job.
your explanation is great sir. understood the whole concept clearly
thank you
Very nice and clear explanation. the main thing is it's a very short video as compare to other creater.
Thanks and appreciate you Sir for ur effort. I have the same question which Abhi asked. Will you upload videos on NumPy, pandas and other libraries. How much python knowledge we should require to get started with a job in python? Do we require knowledge of all libraries and framework like Django, pylons? To start a job in python what we skillset do we actually require in python. Please guide SIR..Thanks a lot
Nice explanation sir.... Thank u so much🤗
This was so much effective for my learning. It helped a lot. Effortless teaching
Fridge example 👏🏻👏🏻 is very practical
Thank you Sir!!
what is the need of finally: if we can just print('resource closed") outside will that make sense?
I thought the same but it does look tidier to the eye... as a logical block of code before embarking on some other idea... kind of like paragraphs in writing prose...
If you do not have the finally clause and you get an error the file won't close. Finally ensures that regardless of the errors taking place in the program , it would perform the task mentioned.
@@aryanfalke5751 i think that u had failed to understand the question correctly. he is asking that what is the need of finally, if we just simply put the 'resource closed' statement outside all the blocks of try and except.
Let just say in your except block you mentioned only 1 type of error ( Value error) and when you run the code you divided any number with 0
In that case the "resource close" statement not going to run
Finally: ensure that every last block of code execute even if there are multiple errors
*See if you write 'resource closed' outside then it will get printed only when there is not an error because the execution stops when there is an error previously*
I love your teaching style, clear and and easy to understand
Great examples Naveen. The doctor and fridge comparisons really made it easy to understand!!
as you always mentioning about it, i will learn java after completion of this course, for sure.
I understand this topic only by ur video, thanks a lot
Navin sir :- God of Programming for me.....Helped me get through interview and many concept 😘
Amazing Teaching skill. God bless you sir.
Amazing work there, will you be making tutorials of creating GUI in python?
I learnt all python by you... thank you so much....very helpful videos for me...
Very clear explanation Sir...Thanks a Lotttttttttttttttttttt Sir
*Best video in this topic*
Thank You Sir
Awesome tutorial. Once you catch the source of the error and get the message, the next step you need to deal with or handling it. How do you go about it????
Hi Navin,
As you mentioned, if we want some piece of code irrespective of whether an exception was caught or not, then, we use finally block.
So, wanted to ask, what if we don't use finally block and instead write that piece of code post our except block. Then too, our piece of code will execute whether or not an exception was caught or not.
Will there be a difference? if yes, what's the benefit of using finally block instead of writing that code after except block?
Example with finally block:
a = 5
b = 0
try:
print("DB connection started")
print(a/b)
except Exception as e:
print("Exception caught !!", e)
finally:
print("DB connection closed")
The same example without finally block:
a = 5
b = 2
try:
print("DB connection started")
print(a/b)
except Exception as e:
print("Exception caught !!", e)
print("DB connection closed")
Since you have given the Exception keyword, it will handle all the exceptions. Try this:
a = 5
b = 0
try:
print("DB connection started")
print(a/b)
except ValueError as e:
print("Exception caught !!", e)
print("DB connection closed")
In the above case the print("DB connection closed") statement would never run. but now try this and the print("DB connection closed") always runs even if any error occurs.
a = 5
b = 0
try:
print("DB connection started")
print(a/b)
except ValueError as e:
print("Exception caught !!", e)
finally:
print("DB connection closed")
Hopefully it made sense now
@@vjnimbalkar thanks Vijay. It helped.
Tqq so much sir. You nailed it.i didn't understood this concept java but you made it clear in Python
Thanks for giving free excellence course for all
Best video so far
Simply simplified my doubt
I like the way you explain things.
Nice video
thank you so much, i was able to figure out my hw because of this video
I am coming from a completely non CS background . That's why it's taking more time for me..but thanks to Navin sir that my concepts are getting cleared..
Thanks alot for this informative video. Please make a video on list, Loc and package.
the practical world understanding of software world you provide as in explaining finally snippet is awesome man, too too cool man
YOU ARE AND YOUR TEACHING IS REALLY GREAT SIR
Tysm!!
very clear and concise, awesome.
Also ,always write general Exception block after writing Dividebyzero,ValueError block ,etc block
Bcoz if by mistake you write it first no matter how much block you write after it, it will always print statement in general exception block .
Very good explanation sir .thank you.
Just amazing 😀😀😀
Wonderful explanation for finally block!!
Excellent explanation. You are an extraordinary teacher🙏
Great teaching style! hats off for simplifying this concept✌
I'm very grateful
Thank you so much sir for great explanation ,
I'm a beginner to python with little programming knowledge, I find this lecture a bit difficult although the explanation was amazing, may be I should go back and revise some terminology
Your teaching is so awesome 🎉
Now I'm recollecting this topic which was taught in class and could make sense with more brevity and logic. Had I watched this earlier, I'd have scored more in exam.
Python is interesting when u r taught by the right person 👍. (Navin sir)
Thank you dear Navin. Very helpful and easy to understand.
Best video ever seen for exception handeling
Wow. Nice explanation. Thank you.........
Wow. A big thumbs up for this video. Made my day.
Thank you.
sir your teaching style is so good.
Pretty clear explanation; thanks for sharing your knowledge.
Hi Telusko
I have a question for python
I don't how to do my homework
my homework is - write a program that repeatedly prompts a user for integer numbers until the user enters 'done'. Once 'done' is entered, print out the largest and smallest of the numbers. If the user enters anything other than a valid number catch it with a try/except and put out an appropriate message and ignore the number. Enter 7,2,bob,10 and 4 and match the output below.
Invalid input
Maximum is 10
Minimum is 2
This is my work
largest = None
smallest = None
while True:
num = input ('Enter a number')
if num == 'done' : break
try:
number = float(num)
except:
print('Invalid input')
for value in (number):
if largest is None :
largest = value
elif float(value) < float(largest):
largest = value
print('Maximum is' ,largest)
for value in (number):
if smallest is None:
smallest = value
elif float(value) > float(smallest):
smallest = value
print('Minimun is' ,smallest)
but the output is not
Invalid input
Maximum is 10
Minimum is 2
I want to know where is wrong
Please help me
chala teluskunnam thank you. you're the best
@Telusko Sir,Please explain about Python Twinkle GUI Development Topics and create project as well as
Waah you taught it in very understandable way. Super sir
Perfect example of learning and enjoying things
Dear sir!
you deserve much.
Thanks a lot
Best explanation that i have ever seen on youtube
thank you for this lesson, well digested