Code Your First Python Program (Quiz)
Francisco Martínez B on July 26, 2023
So far, so good.
alex opoku on Sept. 4, 2023
This course is very good for beginners like me.
john on Sept. 19, 2023
I don’t understand. I have competed the Quiz, but it shows as Not Completed. I passed the Quiz 4 times, but yet it’s the same.
Bartosz Zaczyński RP Team on Sept. 20, 2023
@john You can take quizzes as many times as you want. When you get to the summary of a quiz, it says the following at the bottom:
Click the Mark as Completed button on the course lesson once you feel ready to move on. You can retake this quiz as many times as you like.
So, to mark the corresponding video lesson as complete, you can manually click the button to the left of the Supporting Material dropdown.
john on Sept. 20, 2023
Okay, thaks. Done !!!
Brendan Callaghan on Feb. 10, 2024
Mixed case is referred to as camel case if it starts with lower case letters or pascal case if it’s capitalized in other languages. Well, that’s my experience anyway.
richgacer on April 4, 2024
The coding sections of the quiz are very creative. I appreciate the interactive questions.
Richie Thomas on April 18, 2024
I got the quiz 100%.
Alex on June 18, 2024
I included the colon as of the Hello world text to print
emmanuel on Sept. 26, 2024
Hello, How would you define a traceback error compared to a syntax or runtime error, it’s still unclear to me.
Kind regards
Martin Breuss RP Team on Sept. 26, 2024
@emmanuel a traceback isn’t a separate type of error in itself, but rather the detailed report Python provides when an error occurs. The traceback shows the sequence of function calls that led to the error, helping to pinpoint where and why something went wrong.
To compare with syntax errors and runtime errors:
Syntax Error
This occurs when Python’s parser encounters incorrect syntax. It means you’ve written something that doesn’t follow Python’s grammar rules, like missing a colon, having unmatched parentheses, or using an invalid keyword:
>>> if True
SyntaxError: expected ':'
Runtime Error
This occurs when an error happens while the program is running. Even if the syntax is correct, the program can fail due to issues like dividing by zero, trying to access a variable that doesn’t exist, or performing invalid operations:
>>> print(1 / 0)
ZeroDivisionError: division by zero
Traceback
This is a report that Python generates when it encounters a runtime error. It shows the call stack of what the program was doing when the error occurred, including the line numbers and function calls that led to the error:
>>> def divide(a, b):
... return a / b
...
>>> divide(1, 0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in divide
ZeroDivisionError: division by zero
So, to sum this up:
- Syntax errors prevent the code from even starting.
- Runtime errors occur during execution and stop the program.
- A traceback shows where and why a runtime error occurred, which can help you debug the error.
You can check out our resources on Python Exceptions if you want to read more. Hope this helps to clarify!
emmanuel on Sept. 27, 2024
@Martin Thank you very much this is very clear. To be honest, I did not expect anyone to answer so quickly but you did it and that is wonderful. Last week, I attended a course on another platform as they had a “free trial week”. I learnt about “Devops” but there was a section on advanced python which covered advanced Python concepts like exceptions. I understood the general idea but did not understand fully how useful this can be. I’ll give a try at the resource you highlighted here on this site.
Martin Breuss RP Team on Sept. 27, 2024
@emmanuel great! :D Glad this made sense and hope you’ll find more useful content on our site!
Become a Member to join the conversation.
Vidhya Sagar R on June 21, 2023
The course was desingned by keeping in mind for beginners. It really helps me as a beginner and from non -IT back ground.