Food for thought question?

The third question was implying that your the 27th person in a group of X amount of people so what groups would the 26th and the 28th person be in?

I’m a bit confused on the food for thought bit though everyone has figured some variation of it though is there a simpler way to solve it with the code we’ve learnt through this course?

So now I am a bit confused since I took you literally to see what you were saying and coded: #1 mod 4 1 print(1 % 4) with result = 1. What is the meaning of this result?

4 divided into 1 is 0 with remainder 1. The remainder is the modulo.

The “What are the numbers for all 4 teams?” isn’t a specific enough question to answer. Is it asking what numbers in the count-off will be on each team? Is it asking which team is assigned which number? If we knew what it was asking, we still may not be able to answer because the total number of the group of people has not been specified. Unless I am completely misunderstanding this food for thought exercise, it was an ambiguous, impossible task, which seems very sloppy.

After thinking about it maybe the question is asking which modulo numbers designate teams, meaning the answer would be: 0, 1, 2, and 3 instead of the more intuitive 1, 2, 3, and 4. Maybe they’re trying to get students to think in terms of starting with 0 instead of 1?

I agree that the question could have better put (especially for non English-speaking learners for whom the phrase “count off” is not idiomatic), but do not agree that we were therefore left with an “impossible task.” It’s not as if we needed to come up with a particular solution to proceed, as any response (or none) triggers a green check mark, and a look at this thread and several others shows that the task most certainly did supply “food for thought,” and provided a sandbox for many learners to investigate and experiment with the modulo operator. Not a bad thing!

Team0 = "Team 0: "
Team1 = "Team 1: "
Team2 = "Team 2: "
Team3 = "Team 3: "
My_team = 27 % 4
Person1 = 26 % 4
Person2 = 28 % 4
Count = 0
while Count < 28:
	Count += 1
	Answer = Count % 4
	if Answer == 0:
		Team0 += str(Count) + (",")
	elif Answer == 1:
		Team1 += str(Count) + (",")
	elif Answer == 2:
		Team2 += str(Count) + (",")
	elif Answer == 3:
		Team3 += str(Count) + (",")

My attempt (Sorry i am new at coding)

What is the question? Does your attempt work? Do you have any comments on it?

If you’d like us to follow your code, please post it including Python’s mandatory indentations by making use of the </> icon that is in the menu bar that appears atop the text box when you open it for typing. That way, there’s no guesswork or mental translation involved, and we can copy and paste for testing!

So I was very confused by the wording of this exercise, but eventually i typed this and it just worked. Please understand I am VERY NEW to coding and I would love any help on an explanation on why compared to other people’s answers, mine was still accepted.

my_team = 27 % 4


teams = 26 % 4; 28 % 4


Because that is all that was asked for. If one is number 27 of many, then they are on team # 3 of four teams. The person one number lower is on team # 2, and the person one number higher is on team # 0.

I think I started looking at this question and started overthinking it. I began wondering how to list out each number that would have been assigned to each team. Then I looked at what the tools I have been given and none of them seemed efficient at doing that.
So I looked at the question again.
It asks what are the numbers are for the 4 teams. It’s not asking for the number the person is. It’s asking what the 4 numbers that result from the modulo are

So my code is:
my_team = (27%4)
my_team = (26%4)
my_team = (28%4)
my_team = (29%4)

and it worked.

The “food for thought” question is exactly that–it simply asks you to think about it, figure it out on your own. It is not asking you to actually code anything for this question, so simply hitting “Run” again on the code from the previous answer is fine. Its not broken, it’s working as intended.


Hi @mishmercer2842930051, and welcome to the Codecademy Forums!

Yes, the “food for thought” question is a fine one. It is an invitation to be creative. You can simply think about it, or you can go so far as to write a function that provides an answer.

Link to exercise: Modulo

The “food” for thought" question:

  1. Food for thought: what number team are the two people next to you (26 and 28) on? What are the numbers for all 4 teams?

If we assume that your position and the total number of people are both variable, a function that reveals the numbers of the teams of your neighbor(s) would need two parameters. Be aware that you might be the only person there, in which case you would have no neighbors. If there are at least a few people there, you might be the first or the last to count off. In those cases, you would have only one neighbor. Otherwise, you would have two neighbors. Whatever the case, the function could return a list of the teams of your neighbors.

Here is a suggested function header:

def teams_next_to_you(your_number, number_of_people):

As a challenge, would anyone care to write such a function?

1 Like

I found this to work as a way to display the 4 teams:

team_1 =
team_2 =
team_3 =
team_4 =
i = 1

for i in range(1, 29):
if (i % 4 == 1):
(team_1 == team_1.append (i))
elif (i % 4 == 2):
(team_2 == team_2.append (i))
elif (i % 4 == 3):
(team_3 == team_3.append (i))
(team_4 == team_4.append (i))
i = i + i

print ("Team 1: ", team_1)
print ("Team 2: ", team_2)
print ("Team 3: ", team_3)
print ("Team 4: ", team_4)

#Team 1: [1, 5, 9, 13, 17, 21, 25]
#Team 2: [2, 6, 10, 14, 18, 22, 26]
#Team 3: [3, 7, 11, 15, 19, 23, 27]
#Team 4: [4, 8, 12, 16, 20, 24, 28]

I understand you are theorising the task properly, but as I have zero python knowledge before this course, you could see from my (crude/layman) perspective:

Using only the knowledge that has been taught so far, at this questions point in the course:

You can work out the last team number by repeating the modulo calculation with one more count off number which would make a consecutive sequence of 4 count off numbers.

work out my team and print it first

my_team = 27 % 4

#print the teams for count offs 26 & 28:
print(26 % 4)
print(28 % 4)

find the missing team number by using one more count off number which would make a consecutive sequence of 4 using the existing set (ie: 25 or 29, both produce the same remainder: 1):

print(25 % 4)

In my summarise code by your explanation is:

modulo operation

4 teams and i’m get number 27

my_team = 27 % 4

so i’m in team number 3


Food for thought

team_x = 26 % 4
team_y = 28 % 4
print(‘Number 26 is in team’,team_x)
print(‘Number 28 is in team’, team_y)

1 Like

Hi guys, what I still don’t understand is why Python counts the 0 in the end. Shouldn’t it be 0, 1, 2 and 3? Instead of 1, 2, 3 and 0? What is the explanation for this? Do you have a resource link where I can check the logic of this? Thanks.

Hello, @tera3835921752, and welcome to the Codecademy Forums!

The first instruction in the exercise is as follows:

You’re trying to divide a group into four teams. All of you count off, and you get number 27.

Find out your team by computing 27 modulo 4. Save the value to my_team .

The instruction does not specify the number at which the counting should begin. At what number do you feel it should begin, and to what team does the person who begins the count get assigned?

deserve a hundred like , i read other topic with a lot of traffic but dont get it, i read you and i understand

1 Like

In this question, its not asking you to do something more than what has been shown you so far.

in the next line you rewrite my_team to 26%4, print it then rewrite again to 28%4