Why does print line is invalid syntax? [python] -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 10 उत्तर
  #! / Usr / bin / python def create_table (): mailingTable = open ("mailingTable.txt", "r") लाइनों = lineTable.readline () पंक्तियों में पंक्ति के लिए: प्रिंट लाइन mailingTable.close ()  

यह कहते हैं कि प्रिंट लाइन अमान्य सिंटैक्स है। क्यूं कर? मैं पायथन 3.3.5 का उपयोग कर रहा हूँ

पायथन 3.x में, आपको इस प्रकार लिखना होगा, क्योंकि अब यह एक फ़ंक्शन है:

  प्रिंट (पंक्ति)  

पायथन 2.x में यह को छोड़ना संभव था () , लेकिन यह अब मामला नहीं है।


Comments

Popular posts from this blog

c++ - C/pp Sockets, recv()/send() works only under gdb -

GO: Serve static pages -

objective c - How to open front/back camera at the same time in iOS developing? -