What is the "%" sign for | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the "%" sign for

Wanted a question where he was talked about. I believe it serves to indicate the rest of divisions that will not be exact, but I'm not sure. Thanks to everyone who answered my question, I'll follow the recommendations ;)

25th Apr 2023, 8:51 AM
Sentinela
Sentinela - avatar
7 Answers
+ 9
Sentinela The % symbol in Python is called the Modulo Operator. It returns the remainder of dividing the left hand operand by right hand operand. it is use for reminder Example: 10%2 = 0, 10%3 = 1 10/2 = 5, 10/3 = 3.3 See this.. https://www.freecodecamp.org/news/the-python-modulo-operator-what-does-the-symbol-mean-in-python-solved/ And you should learn first.. https://www.sololearn.com/course/Python
25th Apr 2023, 9:54 AM
Darpan kesharwani🇮🇳[Inactive📚]
Darpan kesharwani🇮🇳[Inactive📚] - avatar
+ 9
Sentinela It's a modulus operator you can get only remainder example:- 5%2 = 1 because you get remainder 1
25th Apr 2023, 10:19 AM
Sakshi
Sakshi - avatar
+ 5
Sentinela You are correct with your assumption. 59%7 = 3 -> 8x7 +3 56%7 = 0 -> 8x7 +0
25th Apr 2023, 10:00 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 3
The sign "%" is called modulo operator, in Python. You can find this in every programming languages, such as C#, Python, JavaScript, etc. Its main function is to calculate the remainder of two numbers in your program. You could start doing the "Python for beginners" course in Sololearn, or you could have a look at some articles of videos which explains you in further detail. Python for beginners course on Sololearn: https://www.sololearn.com/learn/courses/python-introduction Modulo operator article: https://realpython.com/python-modulo-operator/ Modulo operator video: https://www.youtube.com/watch?v=qv-Qdi212X4 Please let me know if you need a further help on this.
25th Apr 2023, 1:32 PM
Danish Zubair
Danish Zubair - avatar
+ 1
Hello Danish, i am grateful for the help, i would like to ask only for media which i can strengthen my understanding of python, i have already put in my list the three courses in this program. Thanks again.
25th Apr 2023, 10:03 PM
Sentinela
Sentinela - avatar
+ 1
Sentinela No problem. If you have any doubt about Python, or any other programming languages, feel free to ask.
25th Apr 2023, 10:05 PM
Danish Zubair
Danish Zubair - avatar
+ 1
Thanks Tuktuk for the answer, and thanks for showing this new course, I hadn't seen it yet
25th Apr 2023, 10:05 PM
Sentinela
Sentinela - avatar