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 trialLukas Johmann
911 PointsRepeating 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
911 PointsThank 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
Python Web Development Techdegree Student 15,937 PointsYep! 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.
Jay Reyes
Python Web Development Techdegree Student 15,937 PointsJay Reyes
Python Web Development Techdegree Student 15,937 PointsVariables can always be updated with new data.