Err, how is saving a value to a variable bad? If the entire point of a different keyword is that it helps stop you from creating one variable then I'd be suspicious... :P
@QPaysTaxes the point is the reverse, why should there be a switch statment when you can implement it using if/else or a dictionary depending on what you want to use it for? Python is based on the idea that there should only be one sensible way to do something, no synonyms please :P
@QPaysTaxes The point is that goto is bad often because it is too general, if your jumping constructs are more rigid your code is likely to be better. This isn't always the case, but for Python I think its just as correct not to include goto as it it to not include switch.
Here are what I see as the different use-cases of a switch statement: 1) different cases do different things - trivially replicated by if-elif-else; 2) some cases do the same thing - trivially replicated by if x in [a,b,c,...]; 3) some cases do the same thing, but some of those do a little extra - trivially replicated by putting an if conditional inside one of the outer if's branches, either before or after the common segment.
@QPaysTaxes You can define functions elsewhere and just put the name in the dict.
Like def foo(): ... and then D = {key: foo}.
Seriously, though, what are you trying to do? This sounds like the X-Y problem.
Yeah, but again, I don't think it would really matter unless you made the question explicitly so that the language you used would be nearly unbeatable.
@EasterlyIrk @Downgoat @CᴏɴᴏʀO'Bʀɪᴇɴ By the way, you guys should turn off viewmodels and get a custom hud. I don't know how anyone plays with the default hud.