syntax - What's the difference between "2*2" and "2**2" in Python? -


निम्नलिखित कोड के बीच अंतर क्या है?

code1 : < / P>

  var = 2 ** 2 * 3  

code2:

  var2 = 2 * 2 * 3  

मुझे कोई अंतर नहीं दिखाई देता है यह निम्न प्रश्न उठाता है।

हम code2 का इस्तेमाल करते हैं तो क्यों code1 का उपयोग किया जाता है?

कोशिश करें:

  2 ** 3 * 2  

और

  2 * 3 * 2  

अंतर को देखने के लिए।

** "की शक्ति" के लिए ऑपरेटर है आपके विशेष संचालन में, 2 की 2 शक्ति की पैदावार 2 गुना 2 के समान होती है।


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -