मैं अजगर में एक नौसिखिया हूं। मैं समझ नहीं पा रहा हूं कि समस्या क्या है?विशेषता त्रुटि: '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
करता है जो आपके द्वारा यहां पोस्ट किए गए कोड से संबंधित नहीं है। कुछ और समस्या होनी चाहिए –
पूरा कोड है ... यदि आप चाहें तो लिंक देखें ... [लिंक] (http://codepad.org/yQXHzIbE) – Gogo