Money and BusinessMeasure processing time with Python’s timeit module. Using the timeit module of the Python standard library, you can easily measure the execution time of a process in your c...30.11.2021Money and Business
Money and BusinessGet the quotient and remainder of a division at the same time using Python’s divmod In Python, you can use "\" to calculate the quotient of an integer and "%" to calculate the remainder (remainder, mod).q...30.11.2021Money and Business
Money and BusinessCounting the number of occurrences of each element in a list with Python’s Counter In Python, the number of all elements in a list or tuple can be obtained using the built-in function len(), and the numb...27.11.2021Money and Business
Money and BusinessBe careful when dealing with Boolean values in Python’s argparse To handle command line arguments in Python, use the argv or argparse modules of the sys module.The argparse module allow...26.11.2021Money and Business
Money and BusinessList of string methods for manipulating uppercase and lowercase letters in Python Python's string type (str) comes standard with convenient methods for manipulating uppercase and lowercase letters. ...24.11.2021Money and Business
Money and BusinessWriting long strings of text on multiple lines in Python If you use a PEP8 compliant code checker such as flake8 in Python, you will get the following error when a line exceeds ...24.11.2021Money and Business
Money and BusinessBatch change a file name in Python by adding a string or sequential number before and after the file name Rename in bulk using the os module and glob module.Use the os module and glob module to change and rename the file names...24.11.2021Money and Business
Money and BusinessSorting a list in Python: the difference between sorted and sorted There are two ways to sort a list in ascending or descending order in Python.sort()sorted()If you want to sort a string ...24.11.2021Money and Business
Money and BusinessGet a list of file and directory names in Python. To get a list of file and directory names (folder names) in Python, use the os module function os.listdir().os.listdir(p...26.10.2021Money and Business
Money and BusinessConvert binary, octal, and hexadecimal numbers and strings to and from each other in Python Python can handle numbers and strings as binary, octal, and hexadecimal numbers as well as the usual decimal numbers. It...26.10.2021Money and Business