python - 'str' object is not callable in my cycling -


  में श्रेणी के लिए (1, 27): temp = str (i) प्रिंट '% s' (temp) .जफिल (3)) ट्रेसबैक (सबसे हाल ही में कॉल अंतिम): फ़ाइल "& lt; ipython console & gt;", पंक्ति 3, & lt; मॉड्यूल & gt; TypeError: 'str' ऑब्जेक्ट कोने योग्य नहीं है   

मुझे आश्चर्य है कि क्यों? ¼ ??

क्योंकि मुझे यह पसंद करने के लिए आउटपुट चाहिए:

  001 002   

..

  021   

...

इसलिए मैं zfill का उपयोग करें। लेकिन अजगर मुझे बताता है कि " str ऑब्जेक्ट लायक नहीं है" इसे कैसे हल करें?

आप % में

  प्रिंट '% s'% (temp.zfill (3)) अनुपलब्ध हैं    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -