Tagged: built-in-functions
Everything tagged "built-in-functions", newest first.
Built-in Functions in Python: A Beginner's Guide
A beginner-friendly guide to Python's built-in functions — what each one does, how to read its result, and where it is used in real programs, with simple examples for input and output, type conversion, numbers, collections, objects and running code.
Python Coding Exercise #30: Number of Characters
A beginner Python exercise on the len() function and if statements — count the characters in a word and print the count only when the word has more than one character.
Python Coding Exercise #26: Random Number Between Two Numbers
A beginner Python exercise on the random module — generate a random whole number between two numbers with randint(), and learn that both ends are included and that the numbers must be in order.
Python Coding Exercise #25: Greatest Common Divisor
A beginner Python exercise on the math module — find the greatest common divisor of two numbers with math.gcd(), and understand what a GCD is and how Euclid's method finds it.
Python Coding Exercise #24: Binary, Octal and Hexadecimal
A beginner Python exercise on number systems — convert a decimal integer to binary, octal and hexadecimal with the built-in functions bin(), oct() and hex(), and learn what the 0b, 0o and 0x prefixes mean.
Python Coding Exercise #23: Slicing and the min() and max() Functions
Two short beginner Python exercises — use string slicing to print the last three digits of a phone number, and use the built-in min() and max() functions to find the smallest and largest of four numbers.