Which of the following is an example of a runtime error in programming? Not using quotation marks and parentheses to print a string literal Printing an inaccurate fact, like print("Dogs have wings.") Trying to perform an impossible task, like 5 / 0 Using camelcase when a variable name contains two or more words
am i right with A?
picking between a and d
Yup, you're right. The others might be considered logical errors or problems with coding convention, but A is the only one that would cause a runtime error
oh ok
it wouldnt be d?
Using camelcase is considered a good practice because it makes the code easier to read, but your code will still run even if you neglect to do that. The computer can't tell what is a word or what isn't a word, it's just a convention for the benefit of humans reading the code
For example, I could define a variable using camelcase like firstName = "Smokey" which is what is preferred. But if I defined a variable without camelcase like firstname = "Smokey" I would still be able to use that variable in my code. It's just considered not as easy to tell what the variable name is supposed to be if you write it that way
oooh okay, it makes sense now
thank you
Sure thing. Glad it makes sense :)
Join our real-time social learning platform and learn together with your friends!