File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -64,19 +64,20 @@ def test_gamma() -> None:
64
64
raise ValueError
65
65
# Ensure print an error message
66
66
except ValueError :
67
- print ("Invalid input: Must be an integer or an half-integer!" )
67
+ print ("Error: Input must be an integer or an half-integer!" )
68
68
number = False
69
69
finally :
70
70
# Ensure input is a valid number
71
71
if number :
72
+ print (f"\u0393 ({ num } ) = " , end = "" )
72
73
# Ensure input is an integer
73
74
if (isinstance (gamma (num ), int )):
74
75
# Print result
75
76
print (gamma (num ))
76
77
# Otherwise print results with √π (gamma of 0.5 is √π)
77
78
# Therefore all results will be a number times √π
78
79
else :
79
- results = "{result:.4f}" . format ( result = gamma (num ) / sqrt (pi ))
80
+ results = f" { gamma (num ) / sqrt (pi ):.4f } "
80
81
results = results .rstrip ('0' ).rstrip ('.' )
81
82
if results == "1" :
82
83
results = ""
You can’t perform that action at this time.
0 commit comments