-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathU5_6_Module.py
More file actions
executable file
·33 lines (28 loc) · 905 Bytes
/
U5_6_Module.py
File metadata and controls
executable file
·33 lines (28 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
####################################################
#
# Uebung:
# Erstellen Sie ein Modul, welches folgende Angaben zu einem Zylinder berechnet:
# - den Umfang: r*2*3.14
# - die Grundfläche: r*r*3.14
# - das Volumen: r*r*3.14*h
#
####################################################
#### Lösung: ####
# KI-Prompt
# Passe nachfolgendes python Script so an, dass die Funktion aus einem externen Script geladen wird.
# Ausgabe des Scripts U5_3_DefaultParameter.py
# Inhalt Datei U56_modul_Zylinder.py:
#####################################
#def zylinder(r,h=10):
# pi=3.14
# umfang = round(r*2*pi,1)
# fläche = round(r**2*pi,1)
# volumen = round(r**2*pi*h,1)
# return umfang, fläche, volumen
#####################################
from U56_modul_Zylinder import zylinder
u, f, v = zylinder(5,12)
print("Angaben Zylinder")
print("Umfang:", u)
print("Fläche:", f)
print("Volumen:", v)