Re: The if is not working properly
On 2019-05-19 11:29, Cameron Simpson wrote: On 18May2019 13:22, nobelio wrote: When you print the variable “a” it appears as True, but the program is it is not getting in the if a==True: It may be that "a" is not the Boolean value True but something else. But that is just a guess. Please reply and paste in a small example programme showing this problem. My guess is that it's the string 'True'. -- https://mail.python.org/mailman/listinfo/python-list
Re: The if is not working properly
On Sun, 19 May 2019 20:29:35 +1000, Cameron Simpson wrote: > On 18May2019 13:22, nobelio wrote: >>When you print the variable “a” it appears as True, but the program is >>it is not getting in the if a==True: > > It may be that "a" is not the Boolean value True but something else. But > that is just a guess. Please reply and paste in a small example > programme showing this problem. > > Cheers, > Cameron Simpson also if a==True is unnecessarily verbose if a: would suffice (unless you explicitly want True & not just a truthy value in which case use if a is True: -- https://mail.python.org/mailman/listinfo/python-list
Re: The if is not working properly
On 18May2019 13:22, nobelio wrote: When you print the variable “a” it appears as True, but the program is it is not getting in the if a==True: It may be that "a" is not the Boolean value True but something else. But that is just a guess. Please reply and paste in a small example programme showing this problem. Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list