Is there a way to list out in-built variables and functions of Python?

0 votes

Hi. I recently found out about the dir() method that lists out the names that a module provides. To use this, you need to import a module and then use the dir() method. 

import datetime
dir(datetime)

I was just wondering if there is a way to list out the in-built functions. Because, we don't import any module to use the in-built functions or names, so how can we list the in-built names?

May 14, 2019 in Python by Yash
173 views

1 answer to this question.

0 votes

The in-built variables and functions are defined in the builtins modules. So you can use the dir() method on this module to list the names. For example:

>>> import builtins
>>> dir(builtins)
answered May 14, 2019 by Junaid

Related Questions In Python

0 votes
1 answer

Is there a foreach function in python and is there a way to implement it if there isnt any

Every occurence of "foreach" I've seen (PHP, ...READ MORE

answered Aug 31, 2018 in Python by charlie_brown
• 7,780 points
208 views
0 votes
1 answer

Is there a way to loop between 0 and 1 by 0.1 in python?

You can use the linespace function. It ...READ MORE

answered May 27, 2019 in Python by Olly
270 views
0 votes
1 answer

Is there a way to store this text in a list using selenium (python)

Try using this code snippet to resolve ...READ MORE

answered Aug 24 in Python by Carlos
55 views
0 votes
1 answer

What is the recommended way to randomize a list of strings using Python?

Hi. Nice question. Here is the simplified answer ...READ MORE

answered Jan 18, 2019 in Python by Nymeria
• 3,520 points
145 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,465 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,800 points
1,094 views
0 votes
1 answer

How to get permutations of list or a set in Python?

Permutation is an arrangement of objects in ...READ MORE

answered Jul 11, 2019 in Python by Neel
• 3,010 points
4,145 views