+ 3
Koloroj
Where is extra True and False?
True or False returns on the basis of comparison
+ 2
Koloroj
Those are not comments. Those are values returned after comparing two values.
+ 1
The True and False that get printed are the values of what's inside print():
x = (2 == 3)
print(x)
# False
print(2 == 3)
# False
0
print(x) is the code that is executed in console.
False, for example is the value that is printed in console
in you console it may look like this
>>> False
0
Writing True anywhere in the script without assigning it or something like that doesn't do much? Maybe they were intended as comments???
0
Koloroj
Are you talking about lesson? Why there those values are given after print statement?
0
Okay, maybe it was meant as comment or example...
https://code.sololearn.com/cRkFl30uiN64/?ref=app
0
Koloroj
That's just for Explanation to understand concepts nothing else.
0
Booleans represent one of two values: True or False.
In programming you often need to know if an expression is True or False.
You can evaluate any expression in Python, and get one of two answers, True or False.
When you compare two values, the expression is evaluated and Python returns the Boolean answer:
Example-
print(10 > 9) # True
print(10 == 9) # False
print(10 < 9) # False
When you run a condition in an if statement, Python returns True or False:
Example
Print a message based on whether the condition is True or False:
a = 200
b = 33
if b > a: # False : the if statement doesn't run
print("b is greater than a")
else:
print("b is not greater than a")
The output of the above code:
b is not greater than a
I hope you understand it đ
0
Hey fill in the blankspace
Open=false
_(_)