商と剰余を出力するプログラムを作成していますが、quotientProblem関数をquotientStringという名前に変更するのは、文字列を直接出力するのではなく文字列を返します。主関数にquotientString関数の各呼び出しの結果を出力させます。'なし'が商と剰余の出力に表示されています
def value():
a=int(input("Enter a number: "))
b=int(input("Enter next number: "))
z=print("When",a,"is divided by",b,"the remainder is",a%b,"and the quotient is",a//b,".")
print (division(a,b,z))
def division(x,y,z):
return z
value()
私はNone
ここ
>>>Enter a number: 5
>>>Enter next number: 3
When 5 is divided by 3 the remainder is 2 and the quotient is 1 .
None
を実行し表示し続けます。
5を3で割ったときの余りは2であり、商は1です。私はこれを表示したい。 –