how to calculate modulus in python?

0 votes
can you give an example with numbers..?
Mar 29 in Python by Waseem
• 4,470 points
60 views

1 answer to this question.

+1 vote

calculate modules in python

mod = a % b

example

15 % 4

output:3  or 

x=[3,1,2,4] 

for a in x:

 print (x % 2)

output: 1 1 0 0

i want to suggest  you if you interested to learn  know more about python modulus and python concept than you  can join best python training in Delhi.

answered Apr 1 by anonymous

Related Questions In Python

0 votes
2 answers

How to calculate square root of a number in python?

calculate square root in python >>> import math ...READ MORE

answered Apr 2 in Python by anonymous
254 views
0 votes
1 answer

How to calculate time interval between two time strings in Python

Try doing this - It is efficient for ...READ MORE

answered Nov 29, 2018 in Python by Nymeria
• 3,520 points

edited Dec 11, 2018 by Nymeria 167 views
0 votes
0 answers
+3 votes
5 answers

How to read multiple data files in python

Firstly we will import pandas to read ...READ MORE

answered Apr 6, 2018 in Python by DeepCoder786
• 1,720 points
2,581 views
+4 votes
7 answers
+2 votes
11 answers
0 votes
0 answers

what is a bitwise operator in python?

can you show some operations using bitwise ...READ MORE

Apr 8 in Python by Waseem
• 4,470 points
35 views
0 votes
0 answers

what is the logical AND operator in python?

how do i use it in a ...READ MORE

Apr 12 in Python by Waseem
• 4,470 points
35 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 337 views