Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
I cannot get the tickets to subtract! Honestly, so FRUSTRATED@!!!
I am trying to get the remaining tickets to print. What am I doing so wrong? Honestly, I want to GIVE UP
Steven Parker210,424 Points
You'd need to post more of the code to be sure, but if "tickets_needed" is assigned from an "input" it would be a string. You'd need to convert it to a number before you could subtract it.
Tomasz FurmanczykWeb Development Techdegree Student 16,079 Points
Automatically python defaults to a string datatype and this is why you need to simply convert tickets_needed:
tickets_remaining = tickets_remaining - int(tickets_needed)
Why do I keep losing my temper over my code not being right???? Am I crazy or what!
sorry I love coding but when I keep getting it wrong I lose it...I don't seem to have patience with it. So after following the suggestions here I do believe I have finally nailed it to the wall...thx