@@ -22,7 +22,7 @@ def menu():
2222 print ()
2323 counter = 0
2424 for fun in operations :
25- print ("{ } {}" . format ( counter , fun .__name__ ) )
25+ print (f" { counter } { fun .__name__ } " )
2626 counter += 1
2727 print ("Bitte eine Zahl für eine der Operationen angeben" )
2828 choice = input (":" )
@@ -45,7 +45,7 @@ def add():
4545 sum1 = input ("Bitte den ersten Summanden eingaben: " )
4646 sum2 = input ("Bitte den zweiten Summanden eingeben: " )
4747 result = float (sum1 ) + float (sum2 )
48- print ("{ } + {} = {}" . format ( sum1 , sum2 , result ) )
48+ print (f" { sum1 } + { sum2 } = { result } " )
4949
5050
5151def sum ():
@@ -60,7 +60,7 @@ def sum():
6060 result = 0.0
6161 for i in values :
6262 result += float (i )
63- print ("sum({}) = {}" . format ( values , result ) )
63+ print (f "sum({ values } ) = { result } " )
6464
6565
6666def product ():
@@ -75,7 +75,7 @@ def product():
7575 result = 1.0
7676 for i in values :
7777 result *= float (i )
78- print ("product({}) = {}" . format ( values , result ) )
78+ print (f "product({ values } ) = { result } " )
7979
8080
8181def difference ():
@@ -88,7 +88,7 @@ def difference():
8888 minu = input ("Bitte den Minuenden eingeben: " )
8989 subt = input ("Bitte den Subtrahenden eingeben: " )
9090 result = float (minu ) - float (subt )
91- print ("{ } - {} = {}" . format ( minu , subt , result ) )
91+ print (f" { minu } - { subt } = { result } " )
9292
9393
9494def quotient ():
@@ -104,7 +104,7 @@ def quotient():
104104 print ("Ungültige Divisor." )
105105 return
106106 result = float (divid ) / float (divis )
107- print ("{ } / {} = {}" . format ( divid , divis , result ) )
107+ print (f" { divid } / { divis } = { result } " )
108108
109109
110110def modulo ():
@@ -120,7 +120,7 @@ def modulo():
120120 print ("Ungültige Divisor." )
121121 return
122122 result = int (divid ) % int (divis )
123- print ("{ } % {} = {}" . format ( divid , divis , result ) )
123+ print (f" { divid } % { divis } = { result } " )
124124
125125
126126def sqrt ():
@@ -132,7 +132,7 @@ def sqrt():
132132 """
133133 radiant = input ("Bitte eine Zahl eingeben: " )
134134 result = math .sqrt (float (radiant ))
135- print ("sqrt({}) = {}" . format ( radiant , result ) )
135+ print (f "sqrt({ radiant } ) = { result } " )
136136
137137
138138def power ():
@@ -145,7 +145,7 @@ def power():
145145 base = input ("Bitte die Basis eingeben: " )
146146 exp = input ("Bitte den Exponenten eingeben: " )
147147 result = pow (float (base ), float (exp ))
148- print ("{ } ^ {} = {}" . format ( base , exp , result ) )
148+ print (f" { base } ^ { exp } = { result } " )
149149
150150
151151def fak ():
@@ -158,7 +158,7 @@ def fak():
158158 result = 1
159159 for i in range (2 , int (x ) + 1 ):
160160 result *= i
161- print ("{ }! = {}" . format ( x , result ) )
161+ print (f" { x } ! = { result } " )
162162
163163
164164def help ():
0 commit comments