Created
April 21, 2018 06:20
-
-
Save shogo82148/1265bdbdbc2050e4adb1c745272ec9c6 to your computer and use it in GitHub Desktop.
PerlとPythonのPolyglot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s="""==; | |
for (1..100) { | |
if ($_ % 3 == 0 && $_ % 5 == 0) { | |
print "fizzbuzz"; | |
} elsif ($_ % 3 == 0) { | |
print "fizz"; | |
} elsif ($_ % 5 == 0) { | |
print "buzz"; | |
} else { | |
print $_; | |
} | |
print "\n"; | |
} | |
__END__ | |
""" | |
for num in range(1, 101): | |
if num % 3 == 0 and num % 5 == 0: | |
print("fizzbuzz") | |
elif num % 3 == 0: | |
print("bizz") | |
elif num % 5 == 0: | |
print("buzz") | |
else: | |
print(num) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s="""==; | |
for (1..100) { | |
if ($_ % 3 == 0 && $_ % 5 == 0) { | |
print "fizzbuzz"; | |
} elsif ($_ % 3 == 0) { | |
print "fizz"; | |
} elsif ($_ % 5 == 0) { | |
print "buzz"; | |
} else { | |
print $_; | |
} | |
print "\n"; | |
} | |
__END__ | |
""" | |
for num in range(1, 101): | |
if num % 3 == 0 and num % 5 == 0: | |
print("fizzbuzz") | |
elif num % 3 == 0: | |
print("bizz") | |
elif num % 5 == 0: | |
print("buzz") | |
else: | |
print(num) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment