Ask coding questions

← Back to all posts
PLS HELP!
epicman702 (218)

Python

Commentshotnewtop
NEILSENBENJAMIN (24)

You can use the modulus (%) operator to check.
For example:
list1 = [4]
list2 = [10]
value = 30

if not value % list1[0]:

# this would mean the value is a multiple of the first value in list[0]
# in this case this statement would fail, 

if not value % list2[0]:

# however this would succeed, there would be no remainder.