+ 1
Where is the error
light_on=True door_locked=False Print(light_on OR door_locked) Print(light_on AND door_locked)
14 odpowiedzi
+ 1
# What exactly do you not understand?
#the program should look like this:
light_on=True
door_locked=False
print(light_on or door_locked)
print(light_on and door_locked)
+ 8
Hi! Please, write:
print -> not Print
or and -> not OR AND
Python is case sensitive language
+ 3
Hanane Nadnassar ,
your answer has no relation to the current topic, so your post can be seen as spam.
+ 2
The strings are not having quotation marks on both side and like the first post,Print should be print and use snake case (_) on all spaces,hope this will solve your problem! (python is a case sensitive language,like the first post said,the orignal is Yaroslav Vernigora ).
+ 2
Anand, True and False is not strings. This is Boolean values. And the result of the logical union /and or/ is also a Boolean value. This part of the program is correct.
+ 2
Yaroslav Vernigora
Now i got it think you
+ 2
Ravindra Singh
It appears that the links cannot be opened here.
+ 1
Yaroslav Vernigora Yaroslav vernigora
Hi! Please, write:
print -> not Print
or and -> not OR AND
Python is case sensitive language
Can you explain that further
+ 1
cmake_minimum_required(VERSION 3.13)
project(hello LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
add_executable(main ${CMAKE_CURRENT_LIST_DIR}/src/main.cpp ${CMAKE_CURRENT_LIST_DIR}/src/functions.cpp)
target_include_directories(main PRIVATE ${CMAKE_CURRENT_LIST_DIR}/include)
+ 1
light_on=True
door_locked=False
Print(light_on or door_locked)
Print(light_on and door_locked)
+ 1
Yaroslav Vernigora ,I learned booleans,now I know, ON should be on ,and AND should be and,by original Yaroslav Vernigora (I am beginner in python,in 2nd on mercury leauge).
+ 1
Anand, You're probably a little confused. I didn't mean the logical operators (not, or, and), but the direct values of boolean /True and False/. They are written with a capital letter and without quotation marks. In your previous advice, you recommended using quotation marks. This should not be done. You're misleading others.
And by the way, where did you get the /on/ operator from? Be careful. Programs (codes) are very sensitive to even the slightest mistakes.
https://www.geeksforgeeks.org/JUMP_LINK__&&__python__&&__JUMP_LINK/python-operators/?ysclid=mhg1z3wzjz700622387
+ 1
# Code example with boolean values
is_raining = True
is_sunny = False
print(is_raining) # Console out: True
print(is_sunny) # Console out: False
if is_raining:
print("Please, take umbrella")
else:
print("You can go without umbrella")
print('True' == True) #Out: False
print(type(is_raining)) #Out: <class 'bool'>
print(type(is_sunny)) # Out: <class 'bool'>



