What is Python Enumerate?

Python Enumerate

Python Enumerate : python enumerate() is basically a python built in function. During certain situations where we deal with lot of iterators we also need to keep count of iterations, in these type of situations python built in function Enumerate comes handy. It helps to add counter to the iterable and returns an enumerate object. The basic syntax :- enumerate(iterable, start=0) The enumerate() function takes two parameters namely : iterable – It is a sequence, an iterator or objects which

Read more

Python Time

Python Time Time

Python Time :  In this article, we’ll see how to use Python’s modules which are related to the time and date. In this python time article we will cover lots of problem like current time, previous time, time gap, epoch time etc. Let us start with the python time first module time. Python Time – Time: First import the time module. Then we will study some important functions of time modules. The time() function The time() function returns the float

Read more

Python modules related to datetime

python datetime

Python datetime modules: In this article, we will see the Python datetime module. We will learn how to create current time, how to calculate the time gap and how to produce time difference?According to Python docs “The python datetime module supplies classes for manipulating dates and times in both simple and complex ways”. So,python datetime modules contains several classes. Let us discuss one by one. Python datetime Modules – The Datetime.datetime Let us discuss the useful methods of datetime.datetime class.

Read more

Python Dictionary

Python Dictionary

Python Dictionary : A Python dictionary is a sequence of key/value or item pairs separated by commas. A Python dictionary is created by using curly braces ( { } ). Syntax to create empty dictionary. < variable-name > = {} Or < variable-name > = dict() Syntax to create Python dictionary with items <variable-name> = { key : value , key : value } The pair of key and value is called item, key and value are separated by colon ( :

Read more

Python For Loop

Python For Loop

Python for Loop Python For Loop – In programming, to repeat an action, loops are used. In Python programming for loop is used to iterate the sequences. In Python, sequences are like String, tuple lists etc. In this article, we will explore the for loop use cases with the interesting examples. This article contains the following topics. for loop with xrange() for loop with Sequences List comprehension Reading the file Nested for loop Python For Loop – for loop with

Read more

Site Footer