7 <=8.... | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

7 <=8....

why is this true...

18th Jan 2017, 5:43 PM
stephen haokip
stephen haokip - avatar
8 ответов
+ 1
"<=" means lesser or equal to and 7 is less than 8.
18th Jan 2017, 6:21 PM
Daniel J. Mangold
Daniel J. Mangold - avatar
+ 1
7<=8 is pretty much the same as 7<9
19th Jan 2017, 6:06 PM
Ryan S
Ryan S - avatar
+ 1
It will returns true Because it's reading it " less or equal " which less is true
22nd Jan 2017, 5:07 AM
Faris
Faris - avatar
+ 1
True
22nd Jan 2017, 5:45 PM
Eshpulatov Sarvar Olim ugli
Eshpulatov Sarvar Olim ugli - avatar
0
Because 7 is smaller or equal then 8. Every pythton number implements __le__ "magic method", for numbers it is the plain old less then or equal. 7 is less then 8 OR seven is equal to 8? Yes! So it returns True
18th Jan 2017, 6:20 PM
edoardo
0
but seven is not equal to eight
18th Jan 2017, 6:23 PM
stephen haokip
stephen haokip - avatar
0
OR Means exactly that either can be 7== 8 (no) Oooorrrrrr 7< 8 (true) :) A OR B is true if a is true and bi is false or if b is true and a is false or if both are true
18th Jan 2017, 6:33 PM
edoardo
0
construction <= may be replaced with next: x < y or x == y. You have True (7<8) or False (7==8), result is True.
18th Jan 2017, 7:10 PM
Алексей БутылкУс
Алексей БутылкУс - avatar