Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

So although we managed to get the number of people right, I was trying to get the sum of price to above 0.

the code could be like def split_check(total, number_of_people): if total <= 1 or number_of_people <= 1: raise ValueError("More than one person is required to split the check") return math.ceil(total / number_of_people)

which raised a weird error... Could you please explain what the flow looks like if I enter the total of -1?

Many thanks,

Zishu

1 Answer

boi
boi
14,242 Points

Could you please post your full code and the error you are getting, so it will be easier and accurate to solve your issue.

Use this link for proper formatting