For some reason, i never clearly understood try-except from any videos. This helped me clearly! Thanks Harry :)
@rajeevmishraa2 жыл бұрын
Don't lie. 🤥
@harpreetkaur99953 жыл бұрын
'''Tip for everyone After writing '''except Exception as e: '''You can '''print("Enter a valid input")
@moviesinhindi67754 жыл бұрын
Aik Dum Cool Way me Ap ne Sumjha Diya Sir.Harry Thank you so much.
@SPEEDMACHGAMINGkg774 жыл бұрын
try-except is very useful in hiding the error in exam😆
@aryanphatarpekar6853 жыл бұрын
😂😂😂
@prajwalurkude0073 жыл бұрын
😂😂
@ayushparmar4543 жыл бұрын
Yesss 😂
@souryasoni793 жыл бұрын
Very useful in Maths Exam..
@procoder96653 жыл бұрын
@@souryasoni79 kaise use karte hai plz thoda batayenge plz
@monimoydeb38324 жыл бұрын
maine kuch din hua python learning start kiya aur bahut chaneel youtube par study kiya and bahut website exm- www.w3school.com but yea channel bahut bahut achha laga keuki sir up jo yea example ki sath wrong and right ka jo diffrences de rahe ho na yah bahut samaj ne kiliye simple hota hain.i like ur channel sir,
@atozshayriandstatus13464 жыл бұрын
Brother Aap college karte ho kya
@alphamindset34934 жыл бұрын
Harry bhai ek. No🔥🔥
@investonomy87583 жыл бұрын
num1 = int(input("enter your first number ")) try: num2 = int(input("enter your second number ")) print("This is the sum of num1 and num2=",num1+num2) except Exception as e: print(e) print ("This line is very important")
@subodhfulzele65012 жыл бұрын
#Try and except for phython print ("Enter first number") num1=int(input ()) print ("Enter second number") num2=int(input ()) try: print ("The sum of two numbers is" num1+num2) except expection as e : print("Harry bhai your god")
@kushaljhunjhunwala474 жыл бұрын
Mazza aa gaya harry bhai sab samajh aa gaya ab tak. is tut tak meine 3 din mei khatam kar diya
@MuhammadKhan-rj2fb2 жыл бұрын
I salute you sir bcz your way of teaching is astonish
@zer0day4635 жыл бұрын
print(100*"Thanks ")
@IsmailHossain-zk1sp3 жыл бұрын
@Musa Matias feku baaz🥱🥱
@IsmailHossain-zk1sp3 жыл бұрын
Maine Bhi kal Modi Ka account hack Kiya tha😎😎
@Gymbrozz993 жыл бұрын
@@IsmailHossain-zk1sp 🙄🙄🙄😂😂😂😂😂😂😂
@goldman22873 жыл бұрын
@ismail Hossain feku bas
@piyushnaithani76894 жыл бұрын
Holy 🐄, you are just going to hit 1M.
@rileystunner35993 жыл бұрын
you were right
@vaibhavjaiswal28543 жыл бұрын
@@rileystunner3599 now going to hit 2M
@shivakarthikrathod20263 жыл бұрын
now 2M
@Vasudev_krishna01711 ай бұрын
v1="tryin try and except" print(v1.upper()) i=18 v2=1 while(v2
@dscinematography73082 жыл бұрын
a=input("Enter 1st input:") b=input("Enter 2nd input:") try: #---to try a particular block of code print("sum is:",int(a)+int(b)) except Exception: #---to run if try is showing error print("only integers input allowed!") else: #---to print if try is right print("You had entered both integers!") finally: #---to print if try or except is executedf print("Program ended!")
@Ishdeepkaur-e5o6 ай бұрын
thanks bro🙏
@pranathisingaraju42483 жыл бұрын
Excellent explaination bhayyiah
@foruse4713 жыл бұрын
Love you Harry bhaiya 😘😘😘😘😘😘
@cooldude81774 жыл бұрын
a=int(input("Enter first number ")) b=(input("Enter second number ")) try: print("Sum of these two numbers is ",int(a)+int(b)) except Exception as k: print(k) print("Hello world")
@ManpreetKaur-gy3kl3 жыл бұрын
Thank you so much sir, to solve long lasting pending confusion. Thanks again sir.
@ManojKumarRager-c5b Жыл бұрын
Awesome way of explanation. Great work bro.
@spiderquizz13614 жыл бұрын
try: print("Enter your number") a = int(input()) print("Enter your second number") b = int(input()) print("sum of both numbers is " , int(a) + int(b)) except Exception as e: print(e) print("this is imp ")
@banjarabikash72474 жыл бұрын
bro if the 6th line in your code will be like this print("sum of both numbers is " , a+b) then it is showing error why? we have already assigned a and b as integer while giving input.
@bushranikhat23264 жыл бұрын
What you are giving as input?
@banjarabikash72474 жыл бұрын
@@bushranikhat2326 if i give any string then it gives error.
@bushranikhat23264 жыл бұрын
Ok ,suppose if you give "e" as input...and try to convert it into integer .Then an error will occur because e cannot be converted into integer..But if you give "5" as input then it wont throw error cause 5 can be converted into iteger..
@banjarabikash72474 жыл бұрын
@@bushranikhat2326 but it is the case of exception. it should print the last line even if i enter string. but it is not doing so.
@dilhaishaayr61424 жыл бұрын
Thanks sir Very well explaination
@aartidongare83962 жыл бұрын
thankyou so much for simple explanation, it was very useful.
@ayushparmar4543 жыл бұрын
Bhot mast sikaya bhai ❤️❤️😭 love you 🔥🙏🏻🔥🔥
@nitishsharma48323 жыл бұрын
harry bhai video mast banaya hai apne
@HariomSingh-ei4fb3 жыл бұрын
This is very very awesome course 😎
@anamta_sayyed3 жыл бұрын
Bhai you're amazing 🙏
@shuvam05164 жыл бұрын
# Harry vai watch this program # I have recently started watching your videos while True: try: print('Enter num1.') num1 = int(input()) print('Enter num2.') num2 = int(input()) print('The sum =',num1+num2) break except Exception as e: print('You entered wrong input',e) print('Thank you! For your correct input.')
@superemeMugwump4 жыл бұрын
Nice program bro, I tried to make it even better below. If you input num1 correctly, but mess up in num2, then the program will keep value of num1 intact and ask to input num2 only. # while True: try: num1 = int(input("Enter 1st no: ")) except Exception as e: print("You entered wrong input:", e) continue break while True: try: num2 = int(input("Enter 2nd no: ")) except Exception as e2: print("You entered wrong input:", e2) continue break print("The sum =", num1+num2, " Thank you for your correct input!") # Nice idea
@shuvam05164 жыл бұрын
@@superemeMugwump Thanks bro . This is exactly what I was trying to do.
@superemeMugwump4 жыл бұрын
Shuvam BC no problem at all !!
@shubhankgupta59374 жыл бұрын
Why is break statement required , it's not a loop
@superemeMugwump4 жыл бұрын
Shubhank Gupta Its while True loop bro, try commenting out break statement, it will keep asking numbers again and again, program will never end
@zafarimam29142 жыл бұрын
nice explain Harish khan(harry bhai)
@amrikdutta4 жыл бұрын
I don’t know why i am playing the last music again and again😅😅 bdw thanks harry bhai
@AjayKashyap-mp4dl4 жыл бұрын
Last music 🎶awesome👍🏻👍🏻
@kishankini34064 жыл бұрын
Me Too!!
@s.a.sproductions99944 жыл бұрын
Because u are addicted
@infinitepossibilities26143 жыл бұрын
Bro.. please give me the link of that music, if you do have...
@s.a.sproductions99943 жыл бұрын
@@infinitepossibilities2614 abhe padhai likhai kro Ias ,vaias bno desh ki seva kroo 👋👋Lekin nai ,nai
@chandanramteke70013 жыл бұрын
Good information
@rahulthapliyal87203 жыл бұрын
very very well video
@shreeji1142 жыл бұрын
harry bhaiya jindabad love from up (bijnor)
@pranjalchandel37325 жыл бұрын
harry bhai bahut sahi samjha rahe ho yaar par aisa kuch bhi karo jaise tweepy library ka use karke twitter pe tweets post karna twitter ka data read karna yeh sab bhi kardo bhai main yeh seekh raha hun aajkal bhai yeh sab...
@ShahidQureshi-ee6wz2 жыл бұрын
Great video dear
@mylove-fp5ey5 жыл бұрын
num1 = input() try: print("Hello",int(num1)) except Exception as t: print(t) print("Ooo problem is fixed") i hope that it will be correct????????????????????
@takebyayush34724 жыл бұрын
wronge
@vanshrana95082 жыл бұрын
Thanks for the video sir amazing as always :)
@Sanketss4 жыл бұрын
harry bahi ye videos delete mat karna future mai boat kam anne vale hai hamare laye ye videos
@codingsky92393 жыл бұрын
Thanks Harry bhai
@prernasonawane72764 жыл бұрын
thanks sir you Are a idol for me
@ashutoshpathak17823 жыл бұрын
print("Enter your num3") num3= int(input()) print("Enter your num4") num4= int(input()) print("The sum of these two number is", num3+num4)
@sjjjaiswal65212 жыл бұрын
Thanks for information 👍
@MrKB_SSJ22 жыл бұрын
thx a lot for the video!
@MANOJKUMAR-pm4hb2 жыл бұрын
supoer bro.. I am starting full Python course which is provided by you only !
@farhanabbasi68303 жыл бұрын
nice video play list i love this course ... love from pakistan bro
@abhishekvashistha23982 жыл бұрын
harry kukkad kamaal da
@pushpendratiwari10325 жыл бұрын
Hi, Harry hope you read this comment. Could please explain if we pass a string in both inputs as statements. Then why exception as 'e' catch only first input string as invalid and why it does not catch the second string input. It would be very helpful for me if you help me to clear this doubt.
@kunwarprashant80282 жыл бұрын
Because when it catches first error, it directly jumps to the "except" part.
@shyampatel16302 жыл бұрын
@@kunwarprashant8028 Right bro
@fatimaahmad5734 Жыл бұрын
Because second input is working corrextly.It has no problem.
@CSESankha Жыл бұрын
bro had to wait 3 years to get the answer
@syedaanam98113 жыл бұрын
2:18 🤣🤣 Sir u r really a hero 😊
@robocodemore34964 жыл бұрын
plz make a playlist of opencv and object recognition
@jitbhaduri42484 жыл бұрын
temp=int(input("Enter the temperature to convert in celcicus to farhenite and vice varsa ")) opr=input("To convert in celcius:Press C To convert in Farenhite:Press F ") try: if opr=="C": print(((temp-32)*5)/9) elif opr=="F": print(((9*temp)/5)-32) except exception as e: print(e) print("Please put your input in C or F in uppercase") """the program can convert your input in celcius to farhenite and vice varsa It also handle the error if you put your input in lowercase"""
@ishtiaqahmad41184 жыл бұрын
Good explained I.A.Siddiqui
@priyasingh-yg2rj5 жыл бұрын
Harry bhai tum ek asi exercise do ya esa program bano jo decimal or simple words ko binary mei change kari hmsei ho nahi paraha hai coding complex hai Tum plzz karo formula sari use kar ki
@grishrana84322 жыл бұрын
guess the number game with try and except: n = 69 x = 5 print("Guess the number game. ") print("No of chances left: 5 ") while x >=1 : guess = input("Enter your number: ") try: if (int(guess) > n): print("Your num is greater!") x = x - 1 print("No of chances left: ", x) elif (int(guess) < n): print("Your number is smaller!") x = x - 1 print("No of chances left: ", x) elif (int(guess) == n): print("Congratulation You have won the game!") break elif (x == 1): print("Game Over") except Exception as e: print(e) print("Please enter number not alphabets.")
@rajatdhiman84292 жыл бұрын
very nice
@flamboyantperson59366 жыл бұрын
Harry bhai ek number tutorial. Ek request hain abhi koi bhi Machine Learning ka tutorial MAT BANAO pura focus python tutorial pe rakho kam se kam 100-200 vidoes bana do python pe. Ek baar hum logo ka python accha hojayega toh Machine learning baad me ho jayega aur easy padega. thank you so much Harry bhai..
@imSagarMalhotra2 жыл бұрын
try: rows=int(input("Enter no. of rows: ")) i=int(input("Enter design: 1. Ascending 2. Descending ")) ascending=True if i==1: ascending=True elif i==2: ascending=False else: print("Invalid input!! Default pattern is Ascending") if ascending: row=1 while(row!=rows+1): print(row *"*") row+=1 else: row=rows while(row!=0): print(row *"*") row-=1 except Exception as e: print("Invalid input!!")
@sailendrachettri85214 жыл бұрын
Maja AaGaya..!!
@umangkumar73734 жыл бұрын
thank you so much bhai jaan
@thestranger95776 жыл бұрын
Bro, please explain local and global variable in this series, pls keep it in your list.....
@motilalbaiga49174 жыл бұрын
Harry bhai AAP to hero hi hai Esme samajhne wali kya baat hai
Harry bhai ur themesong symbols are same as squid games😎
@HassanAli-pm2gd2 жыл бұрын
try: a=input("enter the value1 :") b=input("enter the value2 :") print(int(a)+int(b)) except Exception as e: print("Plz enter the integer value") print(e)
@anshurani86663 жыл бұрын
sir when our program is run then their output gives "invalid literal for int() with base 10:' wee' "....didn't understand it
@prabhatraturi42203 жыл бұрын
you literally tried to change the word "wee" into an integer but it can't be an integer so it throwed an error
@qar79932 жыл бұрын
plz tell me dear how to take petrol price from user and how display??
@dollcyjain24522 жыл бұрын
Same error! But here i entered the number 2 It is throwing error like this: Invalid literal for int() with base 10: ' '
@sandiewebcodes56753 жыл бұрын
print("thanks Harry bhai")
@himanshusharma-es4mw3 жыл бұрын
0:08 what is the name of the intro music
@mayurthorat5124 жыл бұрын
Bhai ap kahase ho?? U r genius programr
@AjayKumar-qf6cn3 жыл бұрын
from 3419 to 1 million great
@black65gaming783 жыл бұрын
Love you harry
@abhichavanke96723 жыл бұрын
first time samaz me aya try and except
@GAURAVSINGH-ez5oe2 жыл бұрын
def gaurav(a,b): sum = a+b return sum n1 = input() n2 = input() try: v = sum(int(n1), int(n2)) print(v) except Exception as e: print(e) print("code abhi b kaam kr raha hai".title())
@muhammadsajjad97694 жыл бұрын
Harry bhae love u from pakistan
@himanshibathla54824 жыл бұрын
thank u so much
@gursimransingh6463 Жыл бұрын
explanation of try statement starts at 3:54
@uttamnishad49274 жыл бұрын
Thank you
@abhinavchoudhary68494 жыл бұрын
Thank you bha
@BreakingNewsin-india4 жыл бұрын
enter num1 f enter num2 6 Traceback (most recent call last): File "C:/Users/pardeep minhas/PycharmProjects/python dudes/Try Except.py", line 9, in int(num1)+int(num2)) ValueError: invalid literal for int() with base 10: ' f' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:/Users/pardeep minhas/PycharmProjects/python dudes/Try Except.py", line 10, in except exception as e: TypeError: catching classes that do not inherit from BaseException is not allowed
@raghavgupta30404 жыл бұрын
GREAT WORK HARRY
@shivamshekhar30205 жыл бұрын
great sir
@karunagarg6074 жыл бұрын
Sir mza aa gya thanku so much sir
@samarthbhandegaonkar21544 жыл бұрын
harry bhai ek question tha ham chrome me jab bina internet ke jate hai to hame your network connection is poor and something like this atta hai use kaise code karte hai .... please tell me
@Aura-Neon_194 жыл бұрын
Love you Harry sir !!! ❤️❤️❤️❤️❤️
@mayankmishra30575 жыл бұрын
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n will be a positive integer. Example 1: Input: 2 Output: 2 Explanation: There are two ways to climb to the top. 1. 1 step + 1 step 2. 2 steps Example 2: Input: 3 Output: 3 Explanation: There are three ways to climb to the top. 1. 1 step + 1 step + 1 step 2. 1 step + 2 steps 3. 2 steps + 1 step bhai please solve this and explain
@pratikmanurkar94213 жыл бұрын
@@Rohit-jp3iv mind blown How did fibonacci show up here
@rituwadhwa225 жыл бұрын
2:10 .... We can write those print statements inside input parentheses num1=int(input("Enter num 1"))
@sush98895 жыл бұрын
absolutely ! you can
@codingbootcamp37054 жыл бұрын
Keep it Up
@originalgangster80344 жыл бұрын
Bro u r the best
@satyakimitra78453 жыл бұрын
1:21 int(input()) kabhi kabhar error throw kar deta hai...
@SScreation952 жыл бұрын
kese padate 😀😀funny....but good
@Pankaj-ws7tq10 ай бұрын
harry bhai if else bhi to use krte hai
@ambujsingh8153 жыл бұрын
bhai console input/output k baare mae bhi padha do
@HKfacts014 жыл бұрын
Harry bhai isme hum except me error ki type likh ke bhi program run kar sakte hai ?
@muhammadahmedansari76264 жыл бұрын
han kar sakty hain BRO.
@saket_saurav2 жыл бұрын
#Watched the video def func(): '''This is for taking two integer inputs from user''' print("Enter num1 ") a=int(input()) print("Enter num2 ") b=int(input()) return a,b def addn(num1,num2): '''This is simply to add two integers''' num3=int(num1)+int(num2) #return num3 print("The sum is ",num3) try: num1,num2 = func() addn(num1,num2) #except Exception as e: except: print("Sorry, please only type integers")
@amanpandey25164 жыл бұрын
sir try and except handling like as a if and elif
@AkashRoy-tq1tu2 жыл бұрын
Brother. If we use, except Exception as a: print(a) print("Lorem Ipsum") Will it work? or we need to write Exception as e only.
@kanishk_NIT_Trichy2 жыл бұрын
you can assign any value not only e . Yes you can use 'a' also
@afsarhussain03263 жыл бұрын
Harry bhai agar koi command ka 1st latter capital me likhna jaruri hai to please mention kar diya karo
@rajabukhsh4 жыл бұрын
nice
@shafi_shami_3 жыл бұрын
Assalamu Alaikum bhaiya, Data structure & Algorithm using with python playlist video banao na bhaiya please 😔