New submission from Samran <iamsamra...@gmail.com>:

#this is the code

from random import randint

num = randint(1,10)

print(type(num))

print(num)

ch = None                                                                       
                    #tried changing this tried converting types

guess = 0

print(type(guess))

print("Welcome to guessing game: ")

 

 

while ch != 'n' or ch != 'N':                                            #here 
is the bug this statement is not running. It works with “and”

                while( guess != num):

                                guess = int(input("Enter your guess?  "))

                                if guess == num:

                                                print("You Guessed Congratz")

               

 

                ch=input("Enter 'y' to play or 'n' to exit: ")

               

 

                if ch=='y' or ch == 'Y':

                                guess= 0

                                num = randint(1,10)

 

print("Thankyou for playing.")

----------
components: Tests
files: Command Prompt - python  test.py 29-Jul-20 9_16_22 PM (2).png
messages: 374576
nosy: Samran
priority: normal
severity: normal
status: open
title: BUG a simple "and" and "or"
type: compile error
versions: Python 3.8
Added file: https://bugs.python.org/file49347/Command Prompt - python  test.py 
29-Jul-20 9_16_22 PM (2).png

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41436>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to