Skip to content

Commit 115b1aa

Browse files
committed
Init ⬆️
1 parent 18fcb78 commit 115b1aa

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

Binär Umwandlung.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def binaer():
2+
try:
3+
x = input("gib Binär ein: ")
4+
print(int(x,2))
5+
binaer()
6+
except:
7+
print("geht nicht")
8+
binaer()
9+
10+
binaer()

Hex Umwandlung.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def heximal():
2+
try:
3+
x = input("gib Hex ein: ")
4+
print(int(x,16))
5+
heximal()
6+
except:
7+
print("geht nicht")
8+
heximal()
9+
10+
heximal()

Klassenbeispiel.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#Dies soll ein Beispiel für eine Klasse sein in Python
2+
3+
class make():
4+
def __init__ (self,color,length,height):
5+
color = self.color
6+
length = self.length
7+
height = self.height
8+
def car(color,length,height):
9+
print ("""The color is %s,the length is %s,The length is %s""" % (color,length,height))
10+
11+
# make.car("red","2.5","3") Beispielausführung des Programms
12+
13+
class do(make):
14+
pass
15+
16+
# Beispiel von Klassenverebung in Python
17+
# do.car("red","2.5","3") Die Methode von der Klasse make wird vererbt
18+
19+
# Alpay Yildirim 06.08.2014 Python 3.4.1

0 commit comments

Comments
 (0)