Jayashree has Published 15 Articles

How to know Maximum and Minimum values for ints in Python?

Jayashree

Jayashree

Updated on 21-Feb-2020 12:51:33

135 Views

Python's core library has two built-in functions max() and min() respectively to find maximum and minimum number from a sequence of numbers in the form of list or tuple object.example>>> max(23,21,45,43) 45 >>> l1=[20,50,40,30] >>> max(l1) 50 >>> t1=(30,50,20,40) >>> max(t1) 50 >>> min(l1) 20 >>> min(t1) 20 >>> min(23,21,45,43) 21

How to find sum a list of numbers in Python?

Jayashree

Jayashree

Updated on 21-Feb-2020 12:30:30

156 Views

Python's built-in function sum() returns sum of numbers in an iterable object such as list or tuple. It takes two arguments, initial value which is optional and 0 by default and iterable objectExample>>> l1=[10,20,30,40,50] >>> ttl=sum(l1) >>> ttl 150 >>> ttl=sum(range(10)) >>> ttl 45

How to find the greatest number in a list of numbers in Python?

Jayashree

Jayashree

Updated on 21-Feb-2020 12:27:17

236 Views

Python's built-in library function max() returns the largest number in an iterable or commaa separated list of numbers.>>> max(10,23,43,21) 43 >>> l1=[4,7,2,9,1] >>> max(l1) 9

How will you explain Python Operator Overloading?

Jayashree

Jayashree

Updated on 30-Jul-2019 22:30:22

275 Views

Every class in Python, whether built-in or user defined is inherited from object class. The object class has a number of properties whose name is preceded and followed by double underscores (__). Each of these properties is a wrapper around a method of same name. Such methods are called special ... Read More

What is @ operator in Python?

Jayashree

Jayashree

Updated on 30-Jul-2019 22:30:22

722 Views

@ symbol is used to define decorator in Python. Decorators provide a simple syntax for calling higher-order functions. By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it.we have two different kinds of decorators in Python:Function decoratorsClass ... Read More

Advertisements