Python return statement A return statement is used to end the execution of the function call and “returns” the result (value of the expression following the return keyword) to the caller. The statements after the return statements are not executed.
Tag: Python-basics
Python end parameter in print()Python end parameter in print()
Python end parameter in print() By default python’s print() function ends with a newline. A programmer with C/C++ background may wonder how to print without newline. Python’s print() function comes with a parameter called ‘end’. By default, the value of
Returning Multiple Values in PythonReturning Multiple Values in Python
Returning Multiple Values in Python In Python, we can return multiple values from a function. Following are different ways 1) Using Object: This is similar to C/C++ and Java, we can create a class (in C, struct) to hold multiple
How to print without newline in Python?How to print without newline in Python?
Print without newline in Python Generally people switching from C/C++ to Python wonder how to print two or more variables or statements without going into a new line in python. Since the python print() function by default ends with newline.
Python *args and **kwargsPython *args and **kwargs
*args and **kwargs in Python In Python, we can pass a variable number of arguments to a function using special symbols. Special Symbols Used for passing arguments:- 1.)*args (Non-Keyword Arguments) 2.)**kwargs (Keyword Arguments) Note: “We use the “wildcard”
Taking input in PythonTaking input in Python
Let’s learn How to take input from User in Python language. Developers often have a need to interact with users, either to get data or to provide some sort of result. Most programs today use a dialog box as a
Python 3 – Hello WorldPython 3 – Hello World
Python is a high-level and Interpreter based language. Python was mainly developed for emphasis on code readability, and its syntax allows programmers to express concepts in fewer lines of code. So, without any ado, let’s start writing our first HELLO WORLD