Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

if function has no argument python

def do_something(calculate=None):
    if calculate is None:
        # do that
        return 'Whatever'
    if calculate == "something expected":
        # do this
    return 'Whateverelse'
Comment

PREVIOUS NEXT
Code Example
Python :: Install pip and add virtual environment to the Python Kernel 
Python :: plot every nth label in barplot 
Python :: simplejwt in django setup 
Python :: timeplanner-1 
Python :: pandas convert text duration to minutes 
Python :: File "main.py", line 11 if message.author == client.user: ^ IndentationError: expected an indented block 
Python :: how to concatenate all list inside list 
Python :: get size of square matrix python 
Python :: how to take integer input in python 
Python :: File "<ipython-input-12-48c6c043344b", line 29 coin = random.randint(0,1) ^ IndentationError: expected an indented block 
Python :: c Pythagorean triples 
Python :: pool does not print process id 
Python :: ex: python arraay 
Python :: qcut and cut function in python stack overflow 
Python :: pandas return indices that match 
Python :: how to detect the body with cv2 
Python :: Can the string find method be used to search a list? 
Python :: remove item from list python grepper 
Python :: qaction hide show python 
Python :: get localapplication python 
Python :: function to sort a list of points based on their x and y-coordinates 
Python :: python continue outer loop 
Python :: python file browser 
Python :: how to randomise a string in python 
Python :: how to add a key in python dictionary 
Python :: break continue pass in python 
Python :: python add column with constant value 
Python :: python while true 
Python :: python global variables 
Python :: pd.explode 
ADD CONTENT
Topic
Content
Source link
Name
2+8 =