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 trialChester Stephen
413 PointsIs there a cleaner and better way to write codes for this exercise i've been doing?
Above is a snapshot of my codes that ive been doing for an exercise. More details on the snapshot.
Is there any functions that I can use to make it more simple?
1 Answer
Steven Parker
230,853 PointsOn line 11, you can eliminate the "str" function, since what "format" returns is already a string.
Otherwise, it seems very compact already. Good job.
Chester Stephen
413 PointsChester Stephen
413 PointsAhh! Great! Thanks Steven. Im still confused on the str,int, float thingy when converting and stuffs.