Food for thought question?

My team number
my_team = 27%4
print(my_team)

person1 = 26%4

person2 = 28%4

** Names of the team:**
Here, I’m taking 1st four-person in a team and finding out modules and placing them in a separate team. The names of the team are their remainder.
From the 5th person, the loop starts with the same remainder as the 1st one and goes on.

print(f"Numbers of the Teams = {1%4},{2%4},{3%4},{4%4}")

This exercise got me confused and that’s because it’s probably not correctly written, I found this, it might help:

To be fair, the lesson/exercise is actually very simple. Broken down as described above helps, but it doesn’t admit to the limitation of the learner; i.e., not understanding modulo. We have for years tried to fill this gap, though it might have been better to let the learner address this deficiency on their own so they have that little success to carry forward.

It comes from which generation we are addressing. That seems to be the dividing line. People who learned arithmetic with a pencil and paper don’t seem to falter with the concept of remainder. Those who learned with a handheld calculator or phone lack that exposure.

To address this, we could use a lesson and exercises on long division that requires the learner to identify the remainder in a long series of division problems. They must work with paper and pencil, and their own brain, notwithstanding, and fill in an answer, much like the questions in the boolean unit.

Bottom line, people who lack the ability to long divide, also hate fractions. They are destined to hit a lot of walls if they do not rectify this learning void.

2 Likes
D = 365          #  Dividend
d = 52           #  divisor
q = D // d       #  quotient (integer division)
R = D - q * d    #  Remainder

That will all be gobbledy-gook to a none initiated learner. It’s math, and that usually means unwanted work. It may be math, yes, but work it is not. It’s plain fun. Begin to see it this way and the world is your oyster.

     q
  ------
d )  D
   - qd
  ------
     R

That’s what it looks like on paper.

2 Likes

super helpful , thank you

Because the lesson is so early on and is designed to show us basic concepts I think you are overthinking the question.

You have correctly discovered the teams for persons 26 and 28, however the answer to the final question may be hidden in your printed response for person 28.

Read it literally. What are the numbers for all 4 teams? They are 0, 1, 2, 3.

This loops back into what the Learn section states when it says that with a modulo if the number is divisible it will equal 0, which is what happens when we divide 28 by 4.

1 Like

Since I know my team is 27 % 4 =3. Each persons team is known by using from number 1 %4 to 28 %4.
Example: 1st person’s team is 1 % 4 = 1, 2nd person’s team is 2 %4 = 2, 3rd person’s is 3 and 4th person = 4 % 4 = 0.

As explained the modulus can’t be greater than the divisor which is 4, hence there is no 5th team and total teams are 1, 2, 3, 0

Going by this, I am (27th person) in team 3, hence 26th will be in Team 2 ( 26 % 4) and 28th in team 0 (28 %4).

1 Like

As you know, my friend, function “int” is decrements the fractional number always down int(27.9)—>27
So,


Another way instead of using “int” is (//)-division without remainder. (15//4)—> 3

1 Like

A post was split to a new topic: Gripe et al

Ok, so we haven’t exactly learned this much yet, but I tried defining a function to do this.
person1 = 26%4

person2 = 28%4

team1 =

team2 =

team3 =

team4 =

def find_team():

for i in range(27):

if i%4 == 0:

  team1.append(i)

elif i%4 == 1:

  team2.append(i)

elif i%4 == 2:

  team3.append(i)

else:

  team4.append(i)

find_team()

print(person1, person2)

print(team1)

print(team2)

print(team3)

print(team4)

My output was
2 0
[0, 4, 8, 12, 16, 20, 24]
[1, 5, 9, 13, 17, 21, 25]
[2, 6, 10, 14, 18, 22, 26]
[3, 7, 11, 15, 19, 23]

So my numbers are just one less than what you got, because I think that range starts with 0? How do I adjust this?

You are missing 27 because it is excluded from the range. Increase the range to 28 and see what happens.

1 Like

Here’s how I tackled Food for thought:

#Question 3

prev_team = 26%4

if prev_team == 0:

prev_team = 4

next_team = 28%4

if next_team == 0:

next_team = 4

print("Number 26 is in team: " + str(prev_team))

print("Number 28 is in team: " + str(next_team))

#Team 4

lst=

for x in range(1, 28):

if x % 4 == 0:

lst.append(x)

print("Team 4 has members: " + str(lst))

#team 3

lst=

for x in range(1, 28):

if x % 4 == 3:

lst.append(x)

print("Team 3 has members: " + str(lst))

#team 2

lst=

for x in range(1, 28):

if x % 4 == 2:

lst.append(x)

print("Team 2 has members: " + str(lst))

Team 1

lst=

for x in range(1, 28):

if x % 4 == 1:

lst.append(x)

print("Team 1 has members: " + str(lst))