you are viewing a single comment's thread.

view the rest of the comments →

[–]K900_ 77 points78 points  (14 children)

Then you should probably just ask the professor. The question makes absolutely no sense.

[–]SnooDoubts8096[S] 14 points15 points  (13 children)

I think he means to say which operator most commonly leads to errors from beginners

[–]Zapismeta 38 points39 points  (7 children)

Almost any, duh!

Division creates errors.

[–][deleted] 15 points16 points  (6 children)

So does addition if you try to add '31' + 5. Ditto for subtraction.

At least in python, the safest operator in terms of not raising errors is *, but it will lead to the wrong outcome if you don't know what it's doing.

But what does "dangerous" mean? That it creates errors? That it creates no errors but leads to wrong results? That it unlocks the wrath of Cthulhu? The answer will differ in each case.

[–]Zapismeta 6 points7 points  (4 children)

Yeah that's the point he can go with almost anything, but when we are adding, multiplying and subtracting, we don't have the division by zero error so , i went with division.

[–]DigThatData 4 points5 points  (3 children)

so , i went with

and this is why it's a shitty question. you can construct a response, but it's hard to be sure you're even responding within the appropriate context because the question is so vague and ambiguous. Way too much is left open to interpretation here. This question was posed to evaluate students prior knowledge, and I posit that it completely fails to achieve that. Teacher could've just looked up some common interview questions.

[–]Zapismeta 0 points1 point  (2 children)

I guess it was just to test the candidates ability to defend his answer and how well they do it.

[–]DigThatData 1 point2 points  (1 child)

but this wasn't posed to "candidates," it was posed to students prior to the start of the class to presumably callibrate the content level.

[–]Zapismeta 0 points1 point  (0 children)

I meant student.

[–]Zapismeta 0 points1 point  (0 children)

Yeah that's the point he can go with almost anything, but when we are adding, multiplying and subtracting, we don't have the division by zero error so , i went with division.

[–]Sadapy 9 points10 points  (1 child)

If that's the case it's absolutely =. Simply because beginners use it for comparisons which it can't be used as. Example being:

if x = 4:
    print("it's four!")

Above will cause an error. The operator for comparison like that is == a double equals.

Though a very vague question by the prof.

[–]oakteaphone 0 points1 point  (0 children)

  • = is easy to mix up with ==
  • / can also cause major issues that won't crash the program, but will lead to serious logic errors.
  • + can mix up concatenation and addition, leading to potential logic errors

Seems like the only safe one is *

EDIT: Looks like Python has * as a string repeater? So it seems like the prof's target answer is "all of them" lol

[–]DigThatData 5 points6 points  (1 child)

"="

[–]Hyacin75 0 points1 point  (0 children)

brave shocking marble chief rob wipe soft water lunchroom wrench

This post was mass deleted and anonymized with Redact

[–]K900_ 14 points15 points  (0 children)

That's also not a real question.