私はPythonの初心者です。私は問題が何であるか理解できません。AttributeError: 'tuple'オブジェクトに属性がありません
def list_benefits():
s1 = "More organized code"
s2 = "More readable code"
s3 = "Easier code reuse"
s4 = "Allowing programmers to share and connect code together"
return s1,s2,s3,s4
def build_sentence():
obj=list_benefits()
print obj.s1 + " is a benefit of functions!"
print obj.s2 + " is a benefit of functions!"
print obj.s3 + " is a benefit of functions!"
print build_sentence()
私は取得していますエラーは次のとおりです。
Traceback (most recent call last):
Line 15, in <module>
print build_sentence()
Line 11, in build_sentence
print obj.s1 + " is a benefit of functions!"
AttributeError: 'tuple' object has no attribute 's1'
いいえ、その完璧な罰金はありません。ちょうど関数を呼び出し、その関数は残りの部分を返します。 – Gogo
これはあなたがここに投稿したコードには関係ありません。他の何かが問題でなければなりません –
コード全体が...あなたが望むならリンクをチェックしてください... [link](http://codepad.org/yQXHzIbE) – Gogo