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.

Python Python Basics All Together Now Gather Information

When I run the program it multiplies the physical number i have inputted by 10. E.G if i input 5 it comes out with 10 5s

Above Question p.s. how do i add a picture of my code??

3 Answers

You’ll need to cast your input to an int, for example: print(int(input())*10)

Scott Bailey
Scott Bailey
13,177 Points

To add your code click on the "Markdown Cheatheet" button below the box you type in and look for the header "code"

Benjamin Perrault
Benjamin Perrault
3,331 Points

I'm having the same issue. I noticed it's solved by separating out the coercion step from the input step, which is odd because I thought they could be combined on one line.

Example 1 gives me the input 10 times when calculated: tickets_requested = int(input("How many tickets would you like, {}? ".format(name)))

Example 2 gives me the input multiplied by 10 (the ticket price) when calculated: tickets_requested = input("How many tickets would you like, {}? ".format(name)) tickets_requested = int(tickets_requested)