Тэги:
#ProgrammingКомментарии:
Extremely effective teaching..... I never understood try and except but you explained it perfectly... I finally understand this now.
Ответить<3
Ответитьthx bro
ОтветитьThank you
ОтветитьAwesome!! That helped me a lot. Thanks.
ОтветитьThanks. I get what you're saying, but it's not working in my code. I'm doing the silly number guessing game. I don't know if anyone is still visiting here and wants to help. I hate going on stack overflow because I'm too much of a noob and everyone complains that posts are repetitive, search other posts, blah blah. Can't even post there without someone making you feel like an idiot. I am an idiot, but I'm trying.
My problem is I have this outside a while loop....
guess = int(input("Pick a number between 1 and 10: "))
Then this is in the while loop
if guess < 1 or guess > 10: print("out of scope, guess again")
elif guess < number: print("Higher: ")
elif guess > number: print("Lower: ")
I want to account for a user that inputs a float (1.1), comma (1,000), or string (one, two, etc..)
I don't know where to put the try block or if I need to have multiple blocks. Maybe put all my code in it. I don't get it. I saw someone once raised an exception, so maybe I can raise exceptions without a try block? Is that easier?
Well, if anyone chimes in, I appreciate it. If not, I'll continue living my life of misery.
thans for your efforts
Ответитьgreat video thank you so much! You are a great teacher.
ОтветитьThank you
Ответитьgreat video, short and straight to the point.
Ответитьlove it, helped a lot thx !
Ответить🙏🎉💐
ОтветитьMesej yang jelas, struktur yang jelas, mudah difahami, terima kasih
ОтветитьGood explanation. Not too complex for us newbies . . . .
ОтветитьWhy is the try block have a green wiggly line?
ОтветитьThank you! Very clear explanation!
Ответитьso why write a code that you know can fail? I'm kind of confused on why use this kind of structure.
Ответитьthatt was beautiful man, thank you , im noobie and i was struggling with a few errors
ОтветитьWhich IDE do you use?
Ответить