## (c) david vajda
## 10/15/2026
## python 3 uebungsprogramm
a=5
b=6
c=a//b
print ("hallo welt")
print ("david vajda")
print ("10/15/2026")
print ("python3 uebungsprogramm")
print (f"a={a}, b={b}, c = a//b = {a}//{b} = {c}")
print (f"a={a}, b={b}, c = b//a = {b}//{a} = {c}")
if a//b < b//a:
print (f"{a} neq {b}")
else:
print (f"{a} eq {b}")
r=a%b
print (f"a = {a}, b = {b}, r = a % b, {r} = {a} % {b}")
print (f"a = {a}, b = {b}, b % a = {b} % {a} = {b%a}")
i=0
while i < 12:
print (f"hallo zum {i+1}ten")
i = i+1
r=0
while r < 5:
c = 0
while c < 10:
print (f"({c},{r}) ", end=" ")
c = c + 1
print ("")
r = r + 1
A=(1, 2, 3, 4, 5, 6)
i=0
print ("A=(", end="")
while i < len(A)-1:
print (f"{A[i]}", end=", ")
i = i + 1
print (f"{A[i]})")
Ms=((1,2,3,4),(4,3,2,1),(1,2,1,2))
Mt=((4,4,2),(2,2,8),(1,2,4),(8,4,2,1))
Md=[]
k=0
while k < len (Mt[0]):
i=0
while i < len (Ms):
j = 0
sp = 0
while j < len (Ms[i]):
sp = sp + Ms [i][j] * Mt [j][k]
j = j + 1
print (f"{sp}", end=" ")
i = i + 1
print ("")
k = k + 1
import random
i = 0
X = []
while i < 12:
X.append (random.randint(1,6))
i = i + 1
i = 0
while i < len(X)-1:
print (f"{X[i]}", end=", ")
i = i + 1
print (f"{X[i]}")
i = 0
c = 0
X = []
while c < 6:
x = random.randint(1,6)
if x < 6:
X.append (x)
else:
X.append (x)
a = 0
k = 1
while bool(X) != 1:
a = a + X.pop ()
k = k + 1
print (f"{a/k}", end=", ")
c = c + 1
i = i + 1
i = 0
while i < len(X)-1:
print (f"{X[i]}", end=", ")
i = i + 1
print (f"{X[i]}")
## ok, darin ist irgendein fehler
def fibonacci (x,y,m):
if y < m:
print (f"{x}, {y}")
fibonacci (y,x+y,m)
fibonacci (1,1,200)
import matplotlib.pyplot as plt
import math
X = []
X.append (0.0)
Y = []
Y.append (0.0)
i = 1
while i < 720:
X.append (X[i-1]+(((2*3.14159265359))/360))
Y.append (math.sin(X[i]))
i = i + 1
plt.plot (X,Y,label="y = sin(x), x=0..4pi")
plt.show ()
zip(X,Y)
import sys
try:
d = open ("sin10152026.csv","w")
except:
print ("error can't open file")
sys.exit (-1)
Z = zip(X,Y)
for z in Z:
d.write (f"{z[0]};{z[1]}\n")
d.close ()
def fibonacci (x,y,m):
if y < m:
return fibonacci (y,x+y,m)
return x+y
X = []
X.append (0.0)
Y = []
Y.append (0.0)
i = 1
while i < 360*8:
X.append (X[i-1]+(((2*3.14159265359))/360))
Y.append (math.sin(fibonacci(1,1,(i//360)%6)*X[i]))
i = i + 1
plt.plot (X,Y,label="y = sin(fib(..)*x), x=0..16pi")
plt.show ()
X = []
X.append (0.0)
Y = []
Y.append (0.0)
i = 1
while i < 360*4:
X.append (X[i-1]+(((2*3.14159265359))/360))
Y.append (math.sin(fibonacci(1,1,(i//120)%6)*X[i]))
i = i + 1
plt.plot (X,Y,label="y = sin(fib(..)*x), x=0..16pi")
plt.show ()