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 Python Basics Functions and Looping Functions

Lukas Johmann
Lukas Johmann
911 Points

Repeating variables, like "result" and "number of characters"

Hello I was wondering, why can we repeat ourselfs with the variables "number_of_characters" and "result" ?
Seems like we can copy these variables multiple times over and it works in the console just fine. Could someone clarify this rule. Thanks, Lukas

Lukas Johmann
Lukas Johmann
911 Points

Thank you for clarifying Jay, that's interesting. I just found an example, in this code;

num_tickets = input("How many tickets would you like, {}? ".format(name))

num_tickets = int(num_tickets)

1 Answer

Jay Reyes
seal-mask
.a{fill-rule:evenodd;}techdegree
Jay Reyes
Python Web Development Techdegree Student 15,937 Points

Yep! We want variables to be easily updated because we might need it's flexibility.

There may be other kinds of objects that can be "locked in" and will never change.