[New-bugs-announce] [issue42933] OUTPUT WRONG

Kkshitish report at bugs.python.org
Fri Jan 15 03:32:18 EST 2021


New submission from Kkshitish <kkshitish at yahoo.com>:

try:
  
  a = 10
  
  if a == 11:
    
    print ("Yes")
    
except:
  
  print ("Out")
  
else:
  
  print ("No")


Output: No

The output should be "Out" but it print "No", The else statement should be print when try condition is execute. But the try condition is not execute on program. But still it print else statement. 

This is not ideal output. If you are disagree with me. So, kindly provide very strong argument over this.

----------
files: main.py
messages: 385100
nosy: Kkshitish
priority: normal
severity: normal
status: open
title: OUTPUT WRONG
type: security
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49745/main.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42933>
_______________________________________


More information about the New-bugs-announce mailing list