Add helloworld examples
Signed-off-by: Christopher Arndt <chris@chrisarndt.de>
This commit is contained in:
		
							parent
							
								
									fb0fed2247
								
							
						
					
					
						commit
						b0d671321d
					
				
							
								
								
									
										1
									
								
								beispiele/hallowelt.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								beispiele/hallowelt.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1 @@
 | 
			
		||||
print("Hallo, Welt!")
 | 
			
		||||
							
								
								
									
										13
									
								
								beispiele/hallowelt2.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								beispiele/hallowelt2.py
									
									
									
									
									
										Normal file
									
								
							@ -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()
 | 
			
		||||
							
								
								
									
										19
									
								
								beispiele/hallowelt3.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								beispiele/hallowelt3.py
									
									
									
									
									
										Normal file
									
								
							@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user