Aktionen

Python-intro-brainstorming

Aus exmediawiki

Linksammlungen


Python Tutorials

Onlinetutorial:

Book:

Videotutorial:

Hands-on Tutorial:


Python logo and wordmark.svg


Code Poetry (with Python)


erste Schritte mit Python...

Variablen setzen

EKI = "Entwickler Künstlicher Intelligenz aus Indien"
HGA = "Höchstens geduldeter Ausländer"
EKI = 1
HGA = 0
Summe = EKI + HGA

Ausgaben mit print()

print(sum)
print("Hallo Welt")

Eingaben mit input()

Text:

input("is EKI in the house? type true for 1 or false for 0:")

Ganzzahl:

int(input("is EKI in the house? type 1 for true or 0 for false:"))

Fließkommazahl:

float(input("is EKI in the house? type 1.0 for true or 0.0 for false:"))

Kontrollstrukturen

if_Anweisung:

if EKI > 1:
     print("true")
else:
     print("false")

siehe auch: Übersicht von Vergleichsoperatoren

Kommentare

Einzeiliges Kommentar

# mit dem Hashtag zu Beginn einer Zeile wird auskommentiert

mehrzeilige Kommentare:

"""In 3 Anführungszeichen
können mehrzeilige Kommentare (__doc__strings)
verfasst werden"""

Python Poetry Example

#that poem do nothing, but can be compile! =D
##http://code.activestate.com/recipes/576413-the-poem-in-python/

#!/usr/bin/env python
#
########   The Poem   #########
###############################
#             by              #
# Marcello Bontempo Salgueiro #
#  08/08/08 - 04:16 AM        #
###############################
def ining(the_poem):
	the_poem='is love'
	the_poem is True
	but , have, some = 'sadness', 'passion', 'love'
	the_poem and 'love' is True
	class Ify:
		is_=('the', 'only', 'way','to')
		try:
			felling='real love'
		except:
			you={'are':'a frozen'}
	the_poem; return '%s'%'ome explanation'
	everything=['is like','a poem']
	for felling_it_go in the_poem:
		writing, your= 'felling','your thoughts';  your_love and fly
	return str('ing of happiness')
belive, this = 'is', 'True' 

nothing='is';w=ining('!')
just='love.'

https://exmediawiki.khm.de/exmediawiki/index.php/Regex


https://exmediawiki.khm.de/exmediawiki/index.php/Vergleichsoperatoren