Python question about booleans | Sololearn: Learn to code for FREE!

+3

Python question about booleans

Hello Dears I have a question in Python: True, False = False, True Print(True, False) Print(2 < 3) Can you explain it please?

3/17/2020 4:55:47 PM

Ablaqulova Mahliyo

9 Answers

New Answer

+6

What you wrote up above doesn't work. You can not assign to keywords in Python. Please repair your post: 1.) Add the proper code in a formatted fashion. 2.) Add proper tags that help others finding your topic. 3.) Ask only one question per post.

+2

I have a question is there a difference between software engineer and backend.frontend programmer ? Which are paid more and easier to work

+2

True, False = False, True Print(True, False) Print(2 < 3)

+2

The True and False is python build-in keyword. The keyword is a reserved word that can not be declared as a variable.

+1

Still wrong. Python is case-sensitive, you have to properly watch out for every letter.

+1

Example boolean True = True True True = False False False = False True If you will see number enumerate (True) 1

0

you can't assign variables to variables. if you want to assign it as a string, put double quotes on the second part.

0

Marulanda Davila, please don't spam. https://www.sololearn.com/discuss/1316935/?ref=app

0

Hello Ablaqulova. In your question; the wrong is your attempt to assign a value for reserved word in Pyhton. Some words are reserved by programming language itself. So you can NOT assign anything to "True" or "False". SyntaxError: can't assign to keyword