+ 1

Boolean Or-explanations

age=15 Money=500 if age>18 or Money>100 print("welcome") Why in the third line is used "or"? I understand the lesson but why it is used here?

4th May 2018, 12:53 AM
Parsix3
Parsix3 - avatar
3 Réponses
+ 1
because want to checked if user got money or age above 18. lf user got money more then 100 (true) but age less 18 (false) , then user still can enter or whatever. At least need 1 statement is true, then message "welcome" showed. If both statement is false, then it goes false and message "welcome" not displayed.
4th May 2018, 1:32 AM
Abdul Qayyum
Abdul Qayyum - avatar
- 1
Plain english- If you have 100$ or your age is above 18 you are welcome.
4th May 2018, 1:54 AM
Akib
Akib - avatar
- 1
--_--
17th Dec 2020, 9:53 AM
arran
arran - avatar