Check if number is divisible by three and two Looks next nested if a little structure redundancy? Any better way for next nested if?
# !/usr/bin/python3

num = int(input(&quot;enter number&quot;))
if num%2 == 0:
   if num%3 == 0:
      print (&quot;Divisible by 3 and 2&quot;)
   else:
      print (&quot;divisible by 2 not divisible by 3&quot;)
else:
   if num%3 == 0:
      print (&quot;divisible by 3 not divisible by 2&quot;)
   else:
      print  (&quot;not Divisible by 2 not divisible by 3&quot;)
Instead of checking for division by 2 and 3 separately twice, you can make use of the fact that:
$$ 2 * 3 = 6$$
num = int(input(&quot;enter number&quot;))
if num % 6 == 0:
    print(&quot;Divisible by 3 and 2&quot;)
elif num % 3 == 0:
    print(&quot;divisible by 3 not divisible by 2&quot;)
elif num % 2 == 0:
    print(&quot;divisible by 2 not divisible by 3&quot;)
else:
    print(&quot;not Divisible by 2 not divisible by 3&quot;)

python pep8 suggests to use 4-whitespace nesting as indentation levels.

Use 4 spaces per indentation level.


If you have more numbers to check divisibility against, keep a set of the numbers for which num % x == 0, and print the factors at the end.