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 trialARCHIT RANA
Full Stack JavaScript Techdegree Graduate 27,853 PointsWhy are we using semicolon in the code?
The instructor added a semicolon after the following statement. But the output is same even without using a semicolon.
print("(Enter Q to Quit)");
So why are we using semicolon here? Please advise. Thanks
1 Answer
Jason Anders
Treehouse Moderator 145,860 PointsHi ARCHIT RANA
Craig teaches both Python and Java here on Treehouse. Like all of us... occasionally one syntax kind of slips into the other language, and Java uses semi-colons to end statements.
While Python does let you use semi-colons to denote an end of a statement, it is not needed or common practice. So, no need to worry about or remember the stray semi-colon in the video, but this is why both work the same.
So, while I can't say for sure, I'm going to guess that Craig Dennis simply had a bit of a Java hiccup. Lol.
Keep Coding! :)
Craig Dennis
Treehouse TeacherCraig Dennis
Treehouse TeacherOld habits die hard ;) Thanks Jason, and yes...just a typo that luckily didn't cause a problem.
Hai Phan
2,442 PointsHai Phan
2,442 PointsThis is not relevant but I really like how you use icons like this . Can you tell me where I can find these?
Jason Anders
Treehouse Moderator 145,860 PointsJason Anders
Treehouse Moderator 145,860 PointsHi Hai Phan
The Treehouse Community utilizes Markdown in the posts. Using markdown, you can make
:question:
become .The list of the markdown emoji markup is hosted here on GitHub.
Hope this helps!!
Keep coding!
Hai Phan
2,442 PointsHai Phan
2,442 PointsThank you so much