Ask your own question, for FREE!
Computer Science 36 Online
Gucchi:

programming help

Gucchi:

1 attachment
Gucchi:

am i right wiht D?

Gucchi:

@extrinix can u just check this last one

Extrinix:

`try/except` works by seeing if an entire group of code can be ran, and if not, gives an `exception` of which allows the programmer to either continue with the code or stop the code. So that's the incorrect answer.

Gucchi:

@extrinix wrote:
`try/except` works by seeing if an entire group of code can be ran, and if not, gives an `exception` of which allows the programmer to either continue with the code or stop the code. So that's the incorrect answer.
hmm so C then its the only one which makes sense

Extrinix:

Can you explain why it makes sense?

Gucchi:

basically i'm checking whether the denominator is zero before performing the division, which prevents the errors from happening

Gucchi:

is that right

Extrinix:

Ah I read your prompt wrong actually. Yeah, it'd be what you chose originally. A divide by zero error would occur, which is what you need to catch before it breaks your program, apologies.

Amorist:

do/while: this is a loop and does not handle exceptions. for/while: are loop structures, not exception handling mechanisms. They control repetitive execution of code, but they don’t handle errors. If division by zero occurs inside a loop, the program will still crash unless it's caught by a try/except block While if/else can be used to check conditions like whether a denominator is zero, it cannot catch runtime exceptions like a division by zero error that occurs after evaluating the condition So, only try/except properly catches and handles runtime errors like division by zero

Amorist:

@extrinix wrote:
`try/except` works by seeing if an entire group of code can be ran, and if not, gives an `exception` of which allows the programmer to either continue with the code or stop the code. So that's the incorrect answer.
I wonder how you got this 'tech crew' label XD

Extrinix:

amorist wrote:
extrinix wrote:
`try/except` works by seeing if an entire group of code can be ran, and if not, gives an exception of which allows the programmer to either continue with the code or stop the code. So that's the incorrect answer.
I wonder how you got this 'tech crew' label XD
By answering questions, obviously.

Gucchi:

thank you

Gucchi:

@extrinix wrote:
amorist wrote:
extrinix wrote:
`try/except` works by seeing if an entire group of code can be ran, and if not, gives an exception of which allows the programmer to either continue with the code or stop the code. So that's the incorrect answer.
I wonder how you got this 'tech crew' label XD
By answering questions, obviously.
i have a few more i really need help with. are you free for a bit

Amorist:

@gucchi wrote:
@extrinix wrote:
amorist wrote:
extrinix wrote:
`try/except` works by seeing if an entire group of code can be ran, and if not, gives an exception of which allows the programmer to either continue with the code or stop the code. So that's the incorrect answer.
I wonder how you got this 'tech crew' label XD
By answering questions, obviously.
i have a few more i really need help with. are you free for a bit
Sure

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Countless7Echos: ik i'm late but finished ToT added some details :p
1 hour ago 3 Replies 0 Medals
Grimson: What's your new years resolution.
13 hours ago 1 Reply 1 Medal
LemmyluvsGelo: Why be sad when you could js be Gone . ud83dudd7a
3 hours ago 5 Replies 2 Medals
Ferrari: anyone have insta??
12 minutes ago 24 Replies 3 Medals
xXAikoXx: I made art
17 hours ago 6 Replies 3 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!