Someone please exaplain me this!!! :- == , <= , >= | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Someone please exaplain me this!!! :- == , <= , >=

29th Oct 2021, 5:30 PM
Kunj Mandaviya
Kunj Mandaviya - avatar
4 Respostas
+ 5
== (we use this to compare if two variable are equal) >=(Greater than or equal) <= ( Lessthan or equal)
29th Oct 2021, 5:39 PM
ŠŠ»ŃŒŃ„ŃŒŃ
ŠŠ»ŃŒŃ„ŃŒŃ - avatar
+ 4
Hi! == equality operator <= less than or equal to >= greater than or equal to Try them! Take a look here: https://www.w3schools.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_operators.asp
29th Oct 2021, 5:43 PM
Per Bratthammar
Per Bratthammar - avatar
+ 1
There are no operator like :- in Python. Maybe itā€™s a part of syntax connected to slices: >>> myList = [1, 3, 5, 7, 9] >>> res = myList[:-1] >>> print(res) [1, 3, 5, 7] >>> It means: take all the elements from the lists begining to the last element in the list (but not the last element), and (shallow) copy them to a new list. So :- is a colon (:), and a minus (-). Or maybe you mean := that is a new way to assign variables inside expression (from Python 3.8), like in: >>> myList = [1, 3, 5, 7, 9] >>> print((lenght := len(myList)) + lenght//2) 7 >>> instead of: >>> myList = [1, 3, 5, 7, 9] >>> print(len(myList) + len(myList)//2) 7 >>>
29th Oct 2021, 7:19 PM
Per Bratthammar
Per Bratthammar - avatar
0
Thank you all šŸ‘šŸ¤—
30th Oct 2021, 11:59 AM
Kunj Mandaviya
Kunj Mandaviya - avatar