学习大多数的编程语言时,基本上都绕不开 hello world
那么python的hello world呢,刚刚在codewars上看到了几个。
切片
def greet():
return 'dlrow olleh'[::-1]
def greet():
return 'The most beautiful hello world'[19:]
编码
greet = 'uryyb jbeyq'.encode('rot13').__str__
def greet():
import zlib,base64
return zlib.decompress(base64.b64decode('eJzLSM3JyVcozy/KSQEAGgsEXQ=='))
这个没看下去,但是看起来很高大上的样子
def greet():
pizza = 0
if (len("Illuminati") - 1) % 3 == 0 and (len("Bush did 9/11") % 9/11 == 0):
for n in range(len("Illuminati")*len("Bush did 9/11")):
pizza += n * 5 / len("pizza")
if pizza != 0 and pizza % len("pizza") == 0:
string = "hello "
if string != "hello world":
second_string = ""
for char in range((len("hello world")-len(string))+1):
if char == 1:
second_string += 'w'
elif char == 2:
second_string += 'o'
elif char == 3:
second_string += 'r'
elif char == 4:
second_string += 'l'
elif char == 5:
second_string += 'd'
if (string + second_string == "hello world") and ((len("Naughty Santa Claus") - len(string)) % 9/11 == (len("Illuminati") % 2)):
try:
'420-topkek!!! * 696969 &&{lolol}' / 2 / 3 / 4 / 5 / 6 / list("dubs")
except:
print__ = 'hello kitty'
if 'kitty' in print__:
kek = print__.replace('kitty', 'world')
return kek
else:
return 'wew lad' * 3
else:
kek = 69
for x in range(1000):
kek += x * 4.20
return kek
else:
pass
else:
if "Bush probably didn't do 9/11 confirmed gg" == True:
return "TOP KEK!!!"
下班,其他的不看了。。。