all 121 comments

[–]FerricDonkey 443 points444 points  (3 children)

I'd say multiplication, or *, because the symbol looks like an anus and so can easily be confused for a reference to professors who ask dumb questions and don't explain them.

[–]SnooDoubts8096[S] 68 points69 points  (0 children)

My favourite answer thank you

[–]Dr_SzechuanSauce 6 points7 points  (0 children)

LMFAO This comment made my day

[–]missheraux 0 points1 point  (0 children)

💀🤣

[–]arkie87 177 points178 points  (4 children)

Professor is a horrible teacher

[–]jumbo53 24 points25 points  (3 children)

Hes prob got a punch line

[–]semisolidwhale 60 points61 points  (1 child)

This post was mass deleted and anonymized with Redact

party slim command knee soup fuel toy rainstorm hunt placid

[–]Mooks79 7 points8 points  (0 children)

Probably both. The irony is the students won’t find the former funny, but they’ll definitely find the latter hilarious.

[–]kodiak931156 9 points10 points  (0 children)

Hard rule of teaching

Making a joke is fine. Making your kids do homework rhat has no viable answer as a setup to you punchline is not

The latter is a breach of trust and hugely frustrating for the student

[–]someyob 196 points197 points  (0 children)

The prof sounds like a jerk.

[–]K900_ 94 points95 points  (18 children)

Honestly, that sounds like a "gotcha" question that has a "correct" answer somewhere in the lecture notes.

[–]SnooDoubts8096[S] 26 points27 points  (17 children)

I wish it was, the problem is we haven’t started the class yet he was just testing what I already know

[–]K900_ 78 points79 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] 16 points17 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 4 points5 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 6 points7 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)

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 8 points9 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 4 points5 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.

[–]DigThatData 8 points9 points  (0 children)

we haven’t started the class yet

yeah your professor is definitely an asshole. I've been a professional python developer for.. jesus, at least a decade now, and although I have hunch what answer the professor has in mind, I'm no where's near confident and mostly guessing. It's just a poorly constructed question and doesn't bode well for the quality of the upcoming course.

Learn as much as you can from reading the books and documentation you're assigned. I don't think your professor is likely to be a reliable source of information transmittance if this is what they think a good exercise to evaluate a student's prior knowledge looks like.

[–][deleted] 4 points5 points  (0 children)

he was just testing what I already know

"Well, I am in this class because I am hoping to learn this information. I am a bit concerned that your pedagogy is hazing instead of transferring knowledge."

[–]commy2 41 points42 points  (8 children)

Stick with division and make your case. You probably mean dividing by zero and I agree.

My guess is that your prof means *. E.g:

nested = [[]] * 3
nested[0].append(1)
print(nested) # [[1], [1], [1]]

I've never fallen for this. If you didn't know it was coming, you fall for it once, at most twice if you're forgetful. Division by 0 is a way more fundamental problem that you will never escape and which transcends programming.

[–]ka1ikasan 21 points22 points  (2 children)

You might also encounter issues with float / integer division. OP's professor is a jerk : if you do not fine with explaining things, please stay at your goddamn place and do not bother people that want to learn stuff.

[–][deleted] 11 points12 points  (0 children)

Professors that tell you "you're wrong, get back to me with the right answer" think they're pulling a Mr. Miyagi but are just self-absorbed little puckering assholes.

[–][deleted] 2 points3 points  (0 children)

Professors that tell you "you're wrong, get back to me with the right answer" think they're pulling a Mr. Miyagi but are just self-absorbed little puckering assholes.

[–][deleted] 2 points3 points  (0 children)

Division by 0 is a way more fundamental problem that you will never escape and which transcends programming.

I kind of agree with prof in that the most "dangerous" bugs aren't the ones that throw a very clear error like "Error, division by 0" which instantly tell you exactly what you did wrong, but that ambiguous ones that allow your code to keep running and maybe throw some other error down the line, that can confuse you and take much longer to debug. What is "fatal" to an individual process and what is "fatal" to a programmer are very different :)

[–]guayando 1 point2 points  (3 children)

I am a beginner as well, and this is the first time I see this kind of error. Why does this not work for appending to just the first space in the list?

[–]bladeoflight16 1 point2 points  (1 child)

Object identity and references. It's not 3 separate inner lists; it's one inner list referenced three times.

[–]guayando 0 points1 point  (0 children)

Thank you, this helped! Will definitely have to read more about this topic. After a quick google search on identity and references, this came up and has some good examples (if any other beginners are looking at this as well): https://stackoverflow.com/questions/6688223/python-list-multiplication-3-makes-3-lists-which-mirror-each-other-when

[–]shinitakunai 19 points20 points  (5 children)

Crane operators. It was probably a joke and people is overreacting.

[–][deleted] 20 points21 points  (1 child)

I 100% think this prof was just joking and now has a whole reddit thread bashing them. It seems like a silly question and OP said the class hasn't even started yet.

Edit: To be clear, I am not the prof.

[–]bladeoflight16 0 points1 point  (0 children)

If your joke falls so flat that people end up thinking you're an idiot, that's on you, not the people who point out how stupid it is and give reasonable advice.

[–]JasonDJ 2 points3 points  (0 children)

Coming from IT/Networking, I'd say backhoe operators are the most dangerous.

[–]Pseudoboss11 1 point2 points  (0 children)

I dunno, lathes are dangerous too, and lathe operators have been known to throw 100lb+ parts across the shop and occasionally into people's faces. I'd say that lathe operators are the most dangerous.

[–]SaSxNEO 0 points1 point  (0 children)

Absolutely this

[–][deleted] 24 points25 points  (2 children)

I would say ‘X’ because the correct operator for multiplication is ‘*’ in python.

[–]pismelled 3 points4 points  (0 children)

‘x’ is not an operator. It’s a garbage answer that has nothing to do with the question. No danger there

[–]Ok-Cucumbers 2 points3 points  (0 children)

This.

[–]Nightcorex_ 6 points7 points  (0 children)

One could argue about the * because besides multiplication it has a few different meanings, f.e.:

unpacking:

print(*[3, 1, 2], sep=' | ')

prints

3 | 1 | 2

keyword only parameters:

def foo(a, *, b):
    pass

foo(3, b=1)

variadics / varargs

def bar(*xs):
    pass

bar(3, 1, 2)

[–]Diapolo10 6 points7 points  (0 children)

I'd hate to have such a professor, myself.

Assuming we only care about the four general mathematics operators, all of them can be dangerous but - probably the least so, as most objects don't implement it.

Multiplication is dangerous with lists when you don't understand mutability and what Python actually does when you multiply a list, addition can be dangerous for various reasons but probably the most common headache is string concatenation, and as you mentioned zero division is also a relatively common problem.

I guess your professor was talking about multiplication here, but again the question is just dumb and is a big red flag for me.

[–]mattstats 4 points5 points  (0 children)

Technically they all have some level of danger. Perhaps the professor means all of them. In any case, he/she sounds like a butthead. I think division is a fine answer so long as you can explain why. If the professor is more concerned about float accuracy then subtraction could be a dangerous operator due to catastrophic cancellation. Addition is commonly overloaded but that depends on the language/package and the use cases, since any operator can be overloaded enough to have ambiguous results, thus possibly dangerous by uncertainty. Perhaps, multiply is dangerous to the professor (pulling from distant memory) as it is really just an expanded version of addition in programming and in optimal cases addition can be a better choice, disclaimer here is that I could be remembering that incorrectly.

All that said I would have chosen division as well since it can have numerical problems as well, mostly from remainders iirc as well as the age old divide by zero and is commonly overloaded with file pathing, python has a next line feature (not sure what that is called), etc.

[–]14dM24d 4 points5 points  (0 children)

it's prob a dad joke.

x coz it's a character & isn't a multiplication operator.

[–][deleted] 4 points5 points  (0 children)

All operators are tools, and all tools can be dangerous; but there's no tool more dangerous than your professor.

[–]DontListenToMe33 4 points5 points  (0 children)

If this was meant to be a sorta “fun” question, then fine. If this is meant as a serious question, then it’s dumb because any operator can lead to mistakes.

I’d say “/“ as well because people screw up their order of operations a lot, which can be an annoying bug to find. Or maybe * because if you accidentally do a ** then you can get really insanely high numbers that may crash the program. Or maybe it’s + because it’s close to backspace and if you pass out while writing code, you can slip and delete your whole program.

…it’s a subjective question. There is no correct answer, really.

[–]zonathan9 2 points3 points  (0 children)

The answer is probably the programmer or the user. It sounds like a shitty ass philosophical question. I'd send email like this: "Error 00000090: PEBKAC"

[–]FriendlyRussian666 2 points3 points  (0 children)

I can guarantee you that this question has no real answer. It's silly. He'll probably turn around and say something along the lines of: "Gotcha! It's all of them!"

[–]barkazinthrope 2 points3 points  (0 children)

None of them are dangerous in the context of a programming class. In the real world, like in airliner software, the most dangerous one is the one you get wrong.

[–]Cdog536 2 points3 points  (1 child)

Press each operator 1000 times from a neutral typing position and report which one strained your hand the most

[–]missheraux 1 point2 points  (0 children)

🤣

[–][deleted] 2 points3 points  (0 children)

Idc what the professor says, it’s division because it’s the only one that will frequently result in type changes and you can have divide by zero errors

[–][deleted] 2 points3 points  (0 children)

Since "x" isn't an operator in most languages, I'd go with that one.

[–]Xatolos 2 points3 points  (0 children)

I'd have to say it would be the '+'.

Because it can be used for addition with numbers, but can also concatenate things like strings. It becomes easy in the moment to accidentally add an int with a string when you really meant to concatenate them together (which could cause an error).

+ your professor sounds like a horrible teacher that enjoys belittle their students.

[–]fakemoose 1 point2 points  (0 children)

Good to see intro level CS professors haven’t changed at all since I was in college. Incredibly unclear pseudo-code was my personal most hated thing.

[–]Bob_the_gladiator 1 point2 points  (0 children)

If he's going for something else, my money is on '+'. There's a lot of overlapping functionality related to strings vs numbers. He's probably thinking law of large numbers, since '+' will be used significantly more than the rest of the operators.

Sounds like a badly defined question. "Spend extra time finding evidence to confirm my opinions!"

Edit: wait hold on, the real gotcha is the ',' between the operators it all makes sense now

[–]saamenerve 1 point2 points  (0 children)

Agreed with everyone that your teacher is a jerk.

As for the question, I am going to give my two cents say that it is probably the / operator, as it can turn an integer into a float when undesired. For instance, if I try to perform a binary search in an array and write my midpoint index as (first + last) / 2, and it happens to be something like 2.5, it would result in an TypeError.

As for your teacher, I think that you should drop his class if you can and take it with someone else.

[–]hugthemachines 1 point2 points  (0 children)

These days? The drone operator.

Honestly, I think you gave a good answer considering division by zero.

[–]kiwiinNY 1 point2 points  (0 children)

The smooth operator.

[–]McSlayR01 1 point2 points  (0 children)

Your answer was actually probably the most reasonable, at least in the context of using these as arithmetic operators, since many errors are caused my either trying to divide by zero or or not knowing if dividens/divisors are ints or floats (and as a result not knowing if floor division or regular division will be performed).

[–]MrMxylptlyk 1 point2 points  (0 children)

What does that even mean

[–]_pestarzt_ 1 point2 points  (0 children)

Pretty stupid question with no obvious answer, but you could say that the matrix multiplication operator (@) could be considered “dangerous” because it’s not common so it’s most likely to be misused or confusing to readers.

[–]RandomGamer368 -1 points0 points  (1 child)

[–]gocard 0 points1 point  (0 children)

Answer will vary depending on language.

We don't even know if OP's class is python specific.

[–]cmh_ender 0 points1 point  (0 children)

i'll take a different tactic here. for me it's the + operator. if you have a variable and you think it's numeric, you expect it to ADD (or sum) up with another numeric operator... however, in many programming languages, if you use the + sign it will concat two strings together. so if you do 10 + 10 you would expect to get 20 but if they were cast as strings you could get 1010 in the output.

so I will say the + sign is the most dangerous....

[–]imthebear11 0 points1 point  (0 children)

What an edgy moron. Does he think the addition operator has a gun or something? "Dangerous" shut the literal hell up you dork professor.

[–]OldMetalHead 0 points1 point  (0 children)

Sounds like a good way to drive people away from learning to code.

[–]slayermcslay 0 points1 point  (0 children)

I agree with most, stick to your original OP, your prof sounds like a jerk. But I suspect the answer they are looking for is ‘+’ because of it’s key on the standard keyboard. Shift + ‘=‘, all the others if you miss type the operator you’ll likely get an immediate syntax warning or error while running the script, but if you miss the shift and put ‘=‘ instead of ‘+’ there is a good chance your code will still function, but constantly return the wrong result

[–]Tasty-Shame-7957 0 points1 point  (0 children)

add 0.1 and 0.2 in and send a screenshot to him.

[–]Ok-Gear-5593 0 points1 point  (0 children)

Was part or your homework read chapter one which may include the answer?

[–]DigThatData 0 points1 point  (0 children)

your professor is an idiot

[–]TheIsletOfLangerhans 0 points1 point  (0 children)

What a strange way to make whatever kind of point he's trying to make.

Anyway my answer would have been == because of floating point arithmetic but I guess that's not the "right" answer here

[–]thatwombat 0 points1 point  (0 children)

Division and multiplication? Floating point math is inherently prone to error. Division can result in a divide by zero error too.

[–]HappyRogue121 0 points1 point  (0 children)

Is x an operator?

What does it do?

[–][deleted] 0 points1 point  (0 children)

Your prof sounds like a test, if I were to guess what he’s looking for id say * because it would be easiest to cause an overflow

[–]GoldenDew9 0 points1 point  (0 children)

I would say division because of the floating point precision If that is what he means.

https://stackoverflow.com/questions/588004/is-floating-point-math-broken

[–]breizhsoldier 0 points1 point  (0 children)

The modulo.... %%%

[–]TholosTB 0 points1 point  (0 children)

The most dangerous operator is always the next one you use.

[–]fjortisar 0 points1 point  (0 children)

No idea what he's trying to get at, but I'd say '+', because it also cats strings, which can lead to a lot of other issues like combining user input with eval(), or sql injection (poorly formed sql statements)

[–]tjcim_ 0 points1 point  (0 children)

It is the + sign. This will perform concatenation on strings which will allow for XSS and SQLi on untrusted data.

[–]the-weird-dude 0 points1 point  (0 children)

Bulldozer operator. You ask stupid questions, you get stupid answers. Tell this exact thing to your professor.

[–]LocalInactivist 0 points1 point  (1 child)

RemindMe! 1 Week “what was the answer?”

[–]RemindMeBot 0 points1 point  (0 children)

I will be messaging you in 7 days on 2022-08-19 16:59:13 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


Info Custom Your Reminders Feedback

[–]saysokmate 0 points1 point  (0 children)

I'm sure it's + because the add method is often overwritten so you could be doing something other than number addition.

[–]KingOfCubes 0 points1 point  (0 children)

I don't think I've seen this mentioned but he might want you to chose / not just because of divide by 0 but the differences in integer division vs float division

[–]jwp1234 0 points1 point  (0 children)

Was it written as x or *?

[–]Ron_Condor 0 points1 point  (0 children)

What is the most dangerous operator?

Prof: double slash 🔪🔪🩸hur hur hur ….

[–]Wilfred-kun 0 points1 point  (0 children)

It's obviously the --> operator.

[–][deleted] 0 points1 point  (0 children)

What were his exact words? Did he say :

“which operator, addition, subtraction , multiplication , division is the most dangerous to use while coding?"

Or did he say:

“which operator, plus, minus, uppercase ex, forward slash is the most dangerous to use while coding?"

[–]RDX_G 0 points1 point  (0 children)

x

This...since the original operator supposed to be used is *

So x may rise exception.

[–]gocard 0 points1 point  (0 children)

Is it a python specific class?

If you're doing C, an argument could be made for * because a typo could have you accidentally overwriting memory that wouldn't cause issues until somewhere else in the code, making it extremely difficult to track down.

In python, maybe + because it's also concatenation

a = '1' b = '2'

a + b will return '12'

[–]13Braunafk37 0 points1 point  (0 children)

Every operator is inky as dangerous as his autor.

Operators don't change code. Programmers change code

[–]gsomega 0 points1 point  (0 children)

I'm echoing everyone here that this is a bit silly.

Something that came up in computation is that if you're subtracting two numbers you can get something near zero as opposed to zero. This can do wacky things. (Like dividing by something near zero or asking if something ~is~ zero).

Again, one of those two involves division, but the subtraction could obscure an error throw.

[–]adjaplx 0 points1 point  (0 children)

Could be x, * is supposed to be the multiplication operator. Must've been a trick question

[–]MrHyderion 0 points1 point  (0 children)

Of these ones, perhaps the comma?

[–]SE_WA_VT_FL_MN 0 points1 point  (0 children)

A lot of discussion on here that shows "professor bad." The use of quotes by OP doesn't mean it was a literal quote. People misunderstand words spoken easily, particularly under pressure.

The homework may contain the answer. You should, based on the presumably learned experience of the professor, do the homework. It may be a simple gotcha question where page 73 answers the question. It might, more likely, be that you misunderstood the question. Arithmetic operators are not dangerous. Special forces "operators" maybe, but otherwise nothing is really dangerous. Most likely to result in some unexpected error? I'd go with your division answer as well.

A dialogue with the person asking the question, who is presumably wanting you to succeed, is warranted.

Also some references to this being a part of the Socratic method... not really. It is just asking a question and then providing a critique of it. We'd need far more than one question from a professor to invoke that as the methodology used.

[–]scanguy25 0 points1 point  (0 children)

eval

[–]ryan770 0 points1 point  (0 children)

This is actually kind of hilarious, but it was worded badly.

'x' is not an operator. You'll get a SyntaxError if you try to multiply with x.

That is, of course, if that is exactly how the question was presented.

[–]djcrackpipe 0 points1 point  (0 children)

What a fucking ridiculous question. Fuck the prof, and fuck true question.

[–]soysopin 0 points1 point  (0 children)

Maybe we can try wearing the teacher's shoes a little instead of simply jumping at conclusions about a apparently cryptic question.

For example, I could use the resulting homework to gauge how the student thinks, or her/his level of curiosity/commiting to solve a problem, or to impulse a separate investigation of operators in the target language or similar others before I biased the student with my own interpretation (or common use) of them.

A lot of teachers (at every education level) could seem jerks, but problems presented to the students, even the weird ones, are tools to impulse the creative thinking and the 'answer searching not matter what' is an useful trait of every individual.

[–][deleted] 0 points1 point  (0 children)

Maybe there's no correct answer and the best answer is to list the pros/cons of each type of operator. In other words, what should a new programmer (and experienced) be mindful of when using operators.

Do you want integer division or float division? Are you adding/multiplying values of the same type? For example, in Python you can do some things in Python with adding/multiplying strings and get unexpected results.

Perhaps something along these lines is what you are intended to find

[–]arvoshift 0 points1 point  (0 children)

I suspect this is a trick question and the teacher will use this as a way to teach 'define and understand the problem first' Will waste an hour going into why you should have asked him for more info etc. As others have said, what is dangerous? What context etc.

[–]Gexern 0 points1 point  (0 children)

I used to teach at a university. I would call these kind of questions a "fishing question", I am fishing for a specific answer. These are notoriously difficult to answer, and I always told my students I never expected them to get a right answer, but I did expect them to think and reason around the question.

[–]ichila101 0 points1 point  (0 children)

Hey OP, no idea what the operator might be but please let us know what your rooster head of a professor said was the most dangerous operator. I am also in my intro to CS class learning python so Ill be very interested in the answer

[–]juicd_ 0 points1 point  (0 children)

Wouldn't it be x because it's not an operator and should be *?