Add helloworld examples
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
parent
fb0fed2247
commit
b0d671321d
|
@ -0,0 +1 @@
|
|||
print("Hallo, Welt!")
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# hallowelt2.py
|
||||
#
|
||||
"""Gebe einen Gruß aus."""
|
||||
|
||||
def hello():
|
||||
"""Gebe "Hallo, Welt!" aus.
|
||||
"""
|
||||
print("Hallo, Welt!")
|
||||
|
||||
if __name__ == '__main__':
|
||||
hello()
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# hallowelt3.py
|
||||
#
|
||||
"""Frage nach dem Namen und gebe einen persönlichen Gruß aus."""
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def hello(name):
|
||||
"""Gebe einen persönlichen Gruß aus."""
|
||||
print("Hallo,", name, "!")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
name_input = input("Wie lautet dein Name? ")
|
||||
|
||||
if name_input.strip():
|
||||
hello(name_input.strip())
|
Loading…
Reference in New Issue