Struck on Comments and Breaks

0 panusha limbu · August 21, 2015
i don't know how to complete the hw assignment .:(  Someone, please help me. i'm determined to learn this before moving on to the next tutional

Post a Reply

Replies

Oldest  Newest  Rating
0 Halcyon Abraham Ramirez · August 22, 2015
which one?
0 Akhil Pillai · August 22, 2015

for i in range(101): #starts from 0 and ends at 100, the value is incremented before the loop begins
    num=i%4 #divides each value of i with 4 and stores remainder in num
    if num is 0: #if value of remainder stored in num is zero
        print(i, " is a multiple of 4") #it will be a multiple of zero
    else:
        print(i, 'is not a multiple of 4') #if value of remainder is not zero, i.e value stored in num is not zero it is not a multiple of 4
0 Jim Fp · August 22, 2015
Can you explain ?
0 Nuno Novoa · August 28, 2015
did u get it? I guess Akhil explained rly nice.
  • 1

Python

107,088 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator