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
2,186 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,720 points
1,107 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 28, 2019 in Python by Olly
3,065 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, 2020 in Python by Carlos
1,516 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,560 points
883 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,391 views
0 votes
1 answer
+5 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,790 points
3,994 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,020 points
8,860 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP