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 in Python by Yash
44 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 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,720 points
88 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 in Python by Olly
68 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 in Python by Nymeria
• 3,520 points
58 views
0 votes
1 answer
+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 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 348 views
+4 votes
6 answers
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 in Python by Neel
• 3,010 points
56 views