Post

Kode Gurukul
Kode Gurukul@kodegurukul·
Answer is C.) Simply, because there's no code inside the try block that raises an exception, the except block is not executed, and the code continues to print "3" after executing the try block.
English
2
1
15
1.3K
Coding Computing Coach
Coding Computing Coach@CodingComputing·
@clcoding Answer: C Solution: If we understand the try-except structure, we can easily solve this question. So let's get into: 1. What try-except is for 2. How try-except works 3. Getting the answer for this code snippet Ready? +
English
3
3
7
1.2K
Samuel Osondu 👑
Samuel Osondu 👑@SamuelOsondu_Py·
@clcoding C) 1 3 Let’s briefly explain the try except in Python. In Python, `try` and `except` are used to handle errors or exceptions in your code. Think of it like this: when your code is running and encounters a problem +
English
1
2
4
783
Karan
Karan@iamkarank5·
@clcoding Output:- 1 3 Explanation:- try function will print 1 except will not run , and print 3 will be executed.
English
0
0
1
49
Prem Prakash
Prem Prakash@4EverPrem·
@clcoding 1 3. No condition is given so Python considers it as Truthy and executes try block, printing 1. Then last line which is outside try & except block is executed, printing 3. Thus output is. 1 3 on separate lines.
English
0
0
1
444
Pacificmultiverse
Pacificmultiverse@Pacificmultiver·
@clcoding c)1 3 Now talking about the 'Try' and 'Except' is used to handle error so using except will make sure not to print 2. So 1 and 3 are printed.
English
0
0
0
7
Arnab Mukhopadhyay
Arnab Mukhopadhyay@arnabmukho2001·
@clcoding Output: 1 3 First try block will run, and since there would be no error so the except block will be skipped, and the last print statement will always run.
English
0
0
0
2
Notsomegoodguy
Notsomegoodguy@Just_Peroxy·
@clcoding Try: Print("1") Except: Print("2") >>>skips this code Print("3") >>>1 >>>3
English
0
0
0
43
Paylaş