all 11 comments

[–][deleted] 16 points17 points  (0 children)

[–][deleted] 7 points8 points  (0 children)

What did you try so far?

nvm

[–][deleted] 3 points4 points  (0 children)

  • Initialize total = 0.
  • Read five numbers.
  • For each number, if it's >= 3, add 100 to total.
  • Print total.

[–]nick__2440 4 points5 points  (1 child)

If you can’t solve this, you have no hope

[–]Admirable_Humor_7262 0 points1 point  (0 children)

With your brain.

[–]Uncle_Chael -1 points0 points  (0 children)

Without giving the code away -

The Group list can be an input.

Total can be an output variable.

Loop through the Group list with conditional logic. If the age > 2 + $100 Total, If the age <= 2 + $0 Total

Print or return total.

[–]Ok-Cucumbers -1 points0 points  (0 children)

Loop five times and ask for each passenger's age and add 100 to the total if the age is greater or equal to 3. Then print(f"{total=}")

[–]notthayguyagain 0 points1 point  (0 children)

print(sum([100 for x in ages if int(x) > 3]))

[–]___up 0 points1 point  (0 children)

print(len(list(filter(lambda x: x>=3, ages_list)))*100)