Pythonic has Published 26 Articles

How you will create your first program in Python?

Pythonic

Pythonic

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

94 Views

You can use any Python aware editor to write Python script. Standard distribution of Python comes with IDLE module which is an integrated development and learning environment. Start IDLE and open a new file from file menu. In the editor page enter print (“Hello World!”) Save the script ... Read More

How to sort a dictionary in Python by keys?

Pythonic

Pythonic

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

459 Views

Standard distribution of Python contains collections module. It has definitions of high performance container data types. OrderedDict is a sub class of dictionary which remembers the order of entries added in dictionary object. When iterating over an ordered dictionary, the items are returned in the order their keys were first ... Read More

How to sort a dictionary in Python by values?

Pythonic

Pythonic

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

2K+ Views

Standard distribution of Python contains collections module. It has definitions of high performance container data types. OrderedDict is a sub class of dictionary which remembers the order of entries added in dictionary object. When iterating over an ordered dictionary, the items are returned in the order their keys were first ... Read More

What is the maximum value of float in Python?

Pythonic

Pythonic

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

598 Views

In sys module, a struct sequence (tuple of named elements) called float_info has been defined. In this structure, an element max returns maximum representable finite float number. >>> import sys >>> sys.float_info.max 1.7976931348623157e+308

What is the maximum length of string in Python?

Pythonic

Pythonic

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

4K+ Views

Maximum length of a string is platform dependent and depends upon address space and/or RAM. The maxsize constant defined in sys module returns 263-1 on 64 bit system. >>> import sys >>> sys.maxsize 9223372036854775807 The largest positive integer supported by the platform's Py_ssize_t type, is ... Read More

What is the maximum size of list in Python?

Pythonic

Pythonic

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

4K+ Views

Maximum length of a list is platform dependent and depends upon address space and/or RAM. The maxsize constant defined in sys module returns 263-1 on 64 bit system. >>> import sys >>> sys.maxsize 9223372036854775807 The largest positive integer supported by the platform's Py_ssize_t type, is ... Read More

Advertisements