Programming/Polyglot Problems: Difference between revisions
Jump to navigation
Jump to search
(Created page with "''Have you ever gotten syntax errors because you know how to do the thing in one language but can't remember how to do that the other one?'' {| !Java !C# !Python !Ruby |- |...") |
No edit summary |
||
Line 1: | Line 1: | ||
''Have you ever gotten syntax errors because you know how to do the thing in one language but can't remember how to do that the other one?'' | ''Have you ever gotten syntax errors because you know how to do the thing in one language but can't remember how to do that the other one?'' | ||
==If-Statements== | |||
<syntaxhighlight lang="python" line='line'> | <syntaxhighlight lang="python" line='line'> | ||
if condition: | |||
do_thing | |||
elif other_condition: | |||
do_other_thing | |||
else: | |||
do_else_thing | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 29: | Line 15: | ||
if condition | if condition | ||
do_thing | do_thing | ||
elsif | elsif other_condition | ||
do_other_thing | do_other_thing | ||
else | else |
Revision as of 19:31, 1 February 2021
Have you ever gotten syntax errors because you know how to do the thing in one language but can't remember how to do that the other one?
If-Statements
if condition:
do_thing
elif other_condition:
do_other_thing
else:
do_else_thing
if condition
do_thing
elsif other_condition
do_other_thing
else
do_else_thing
end