[PYTHON] List of frequently used built-in functions and methods

Introduction

Recently, I'm not sure if it's a built-in function or a method, so I tried to classify the ones I use often.

Click here for all built-in functions

Built-in functions function
print() ()Show inside
str() Returns an object of type str
int() Returns an object of type int
float() Returns an object of type float
bool() Returns a bool type object. Empty, 0, None returns False
type() Returns the type of the object
input() Enter a string(Input value is treated as a character string)
len() Get the number of elements
abs() Returns the absolute value
sum() Returns the total
max() Returns the maximum value
min() Returns the minimum value
pow(a, b) Returns a to the bth power
range() Returns a sequence of integers in the specified range
round() Round the value. The second argument is the number after the decimal point
hex() Returns a hexadecimal number
oct() Returns an octal number
bin() Returns a binary number
enumerate() Get the sequence and index. The second argument is the index start number, the default is 0
open() Open file
Method function list Tuple Remarks String
.append() Add an element to the end of the list
.extend() Add a sequence to the end of the list. You can add lists, tuples and dictionaries
.reverse() Reverse the order of list elements
.sort() Sort list elements
.remove() Searches for the same element as the specified value and deletes the first element. The element itself is rewritten
.count() Count how many elements are in the list
.pop() Extract only one element of the specified index
.clear() Delete all elements
.keys() Loop processing for dictionary type key
.values() Loop processing for dictionary type value
.items() Loop processing for dictionary type key and value
.keys() Loop processing for dictionary type key
.values() Loop processing for dictionary type value
.items() Loop processing for dictionary type key and value
.upper() Convert the whole to uppercase
.lower() Convert the whole to lowercase
.capitalize() Make the first letter uppercase and the others lowercase
.replace(a, b) Replace string a with string b
.split() Split a string by specific characters
.join(sequence) Get a concatenated string
.index() Returns the index value at the position where the first specified character appears
.format() {}To()Replace within

Recommended Posts

List of frequently used built-in functions and methods
Frequently used methods of Selenium and Beautiful Soup
List of frequently used Linux commands
Summary of built-in methods in Python list
[Machine learning] List of frequently used packages
Paiza Skill Check List of Frequently Used D and C Ranks ~ Python ~
List of activation functions (2020)
Selenium webdriver Summary of frequently used operation methods
Comparison table of frequently used processes of Python and Clojure
Display a list of frequently used commands on Zsh
Frequently used subpackages of SciPy
[Introduction to Python] Summary of functions and methods that frequently appear in Python [Problem format]
[Golang] Notes on frequently used functions
[Anaconda3] Summary of frequently used commands
Summary of frequently used commands of django (beginner)
Summary of methods often used in pandas
Summary of frequently used commands in matplotlib
Example of using class variables and class methods
[Linux] List of Linux commands used in practice
Built-in functions
Modules of frequently used functions in Python (such as reading external files)
[Linux] Review of frequently used basic commands
Correspondence between Python built-in functions and Rust
List of main probability distributions used in machine learning and statistics and code in python
[Python/Django] Summary of frequently used commands (3) <Operation of PostgreSQL>
Organize the meaning of methods, classes and objects
Utilization of recursive functions used in competition pros
Full disclosure of methods used in machine learning
Smoothing of time series and waveform data 3 methods (smoothing)
Summary of evaluation functions used in machine learning
Summary of frequently used Python arrays (for myself)
List of Python code to move and remember
[Linux command] A memorandum of frequently used commands
[Python/Django] Summary of frequently used commands (2) <Installing packages>
Summary of frequently used commands (with petit commentary)
list and sum
list and numpy
Python's built-in functions
Mayungo's Python Learning Note: List of stories and links
List of Python libraries for data scientists and data engineers
Writing using lambda expressions and filter functions and writing using list comprehensions
Add a list of numpy library functions little by little --a
A collection of commands frequently used in server management
Summary of Pandas methods used when extracting data [Python]
List of Python code used in big data analysis
Python: Get a list of methods for an object
Private memos used for list operations and competitive programming
[Python] Types of statistical values (features) and calculation methods
EP 7 Use List Comprehensions Instead of map and filter
[For beginners] Django Frequently used commands and reference collection
[Scientific / technical calculation by Python] List of usage of (special) functions used in physics by using scipy