Help Question 2.1 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help Question 2.1

#print( ( 23 + 27 + 18 ) * 2 ) This is my answer can someone assist me and give feedback The question was : Today is a holiday at the children's camp, so all the children will be served ice cream. There are 3 groups of children: 23 children in the first group, 27 in the second, and 18 in the third. Every child should get 2 scoops of ice cream. Write a program to calculate and output the total number of ice cream scoops we need.

23rd Feb 2021, 11:01 PM
Travantae
Travantae  - avatar
3 Answers
+ 1
print( ( 23 + 27 + 18 ) * 2 )
31st Dec 2021, 4:39 PM
Abdi Jiru
0
thank you i figured it out as well the code didnt work i forgot to remove the hashtag... silly mistake
23rd Feb 2021, 11:19 PM
Travantae
Travantae  - avatar
- 1
Your code looks good. The only improvement would be if children are in more than one group. In that case you could make an array for each group and find the length of the union of the three (you would also need to populate the arrays with children), but since your question isn't that complicated I think you got the right answer. Good job. :)
23rd Feb 2021, 11:15 PM
madeline
madeline - avatar