Meaning of the tilde sign ~ in Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Meaning of the tilde sign ~ in Python

What is the role of tilde sign in puthon?

7th Mar 2021, 4:45 PM
Boubaker Benaissa
Boubaker Benaissa - avatar
3 Answers
+ 6
It's used as a mathematical operator in all programming languages. https://www.sololearn.com/learn/4076/?ref=app
7th Mar 2021, 4:59 PM
Simba
Simba - avatar
+ 4
Tilde is bitwise negation operator. It flips 1's with 0's and vice versa. This operation takes place in binary level. Read this article to know more: https://blog.finxter.com/tilde-JUMP_LINK__&&__python__&&__JUMP_LINK/#:~:text=What%20is%20the%20Tilde%20~%20in,1%20and%20~101%20becomes%20010%20.
7th Mar 2021, 4:51 PM
Abir Hasan
Abir Hasan - avatar
0
Can you show an example of where you saw it used as i don't think i have seen it before.
7th Mar 2021, 4:48 PM
Abhay
Abhay - avatar