Computer >> कंप्यूटर ट्यूटोरियल >  >> प्रोग्रामिंग >> Python

Python में howdoi


Python सूची बनाएं

उदाहरण

C:\Py3Project>howdoi create a python list

आउटपुट

उपरोक्त कोड चलाने पर हमें निम्नलिखित परिणाम मिलता है -

>>> l = [None] * 10 >>> l [None, None, None, None, None, None, None, None, None, None]

आज की तारीख प्रिंट करना

उदाहरण

c:\python3>howdoi print today's date in python

आउटपुट

उपरोक्त कोड चलाने पर हमें निम्नलिखित परिणाम मिलता है -

for date in mylist : print str(date)

उदाहरण

c:\python3>howdoi create fibonacci series in python

आउटपुट

उपरोक्त कोड चलाने पर हमें निम्नलिखित परिणाम मिलता है -

def F(n):     if n == 0: return 0     elif n == 1: return 1     else: return F(n-1)+F(n-2)

उदाहरण

c:\python3>howdoi use calendar in javascript

आउटपुट

उपरोक्त कोड चलाने पर हमें निम्नलिखित परिणाम मिलता है -

You can choose from Material UI. https://www.material-ui.com/#/components/date-picker https://www.material-ui.com/#/components/time-picker

उदाहरण

c:\python3>howdoi go to north pole

आउटपुट

उपरोक्त कोड चलाने पर हमें निम्नलिखित परिणाम मिलता है -

I believe the difference is because GPS uses the geographical North/South Pole rather than the magnetic ones. The further north you are, the bigger the difference is to where you are. The GPS satellite positions need to be absolute, and using a fluctuating point of reference like the magnetic poles is a big no-no.

  1. CSS में display: none CSS में display: none

    एलिमेंट हटाएं किसी एलिमेंट को हटाने के लिए CSS में display: none प्रॉपर्टी मान का उपयोग करें। उदाहरण 1 <!DOCTYPE html> <html> <head> <style> span { background-color: orange; color: white; } p.demo { display: none; } span.demo1 { display: inline; } </style> </head>

  1. - पायथन में ArithmeticError एक्सेप्शन कैसे पकड़ें?

    ArithmeticError एक्सेप्शन उन सभी एरर्स के लिए बेस क्लास है जो संख्यात्मक गणनाओं के लिए होते हैं। यह उन बिल्ट-इन एक्सेप्शन्स के लिए बेस क्लास है जैसे: OverflowError, ZeroDivisionError, FloatingPointError। हम दिए गए कोड में एक्सेप्शन को निम्न प्रकार से पकड़ सकते हैं: उदाहरण import sys try: 7/0 exc

  1. - पायथन फंक्शन से None कैसे लौटाएं?

    बिना रिटर्न स्टेटमेंट वाले फंक्शन, जिन्हें वॉयड फंक्शन कहा जाता है, फंक्शन से None लौटाते हैं। None के अलावा कोई मान लौटाने के लिए, आपको फंक्शन में रिटर्न स्टेटमेंट का उपयोग करना होगा; ऐसे फंक्शन को फ्रूटफुल फंक्शन कहा जाता है। None, True और False जैसे मान स्ट्रिंग्स नहीं हैं: वे पायथन में विशेष मान