File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ def quotient():
100100 """
101101 divid = input ("Bitte den Dividenden eingeben: " )
102102 divis = input ("Bitte den Divisor eingeben: " )
103+ if int (divis ) == 0 :
104+ print ("Ungültige Divisor." )
105+ return
103106 result = float (divid ) / float (divis )
104107 print ("{} / {} = {}" .format (divid , divis , result ))
105108
@@ -113,6 +116,9 @@ def modulo():
113116 """
114117 divid = input ("Bitte den Dividenden eingeben: " )
115118 divis = input ("Bitte den Divisor eingeben: " )
119+ if int (divis ) == 0 :
120+ print ("Ungültige Divisor." )
121+ return
116122 result = int (divid ) % int (divis )
117123 print ("{} % {} = {}" .format (divid , divis , result ))
118124
@@ -150,7 +156,7 @@ def fak():
150156 """
151157 x = input ("Bitte eine Zahl eingeben: " )
152158 result = 1
153- for i in range (2 , x + 1 ):
159+ for i in range (2 , int ( x ) + 1 ):
154160 result *= i
155161 print ("{}! = {}" .format (x , result ))
156162
You can’t perform that action at this time.
0 commit comments