DEV Community

loading...

Charming the Python: Builtins and Variables

Vicki (she/her)
Vicki was once a manager of aircraft maintenance and is now charming Python. She coded #VetsWhoCode bot & Code Questions bot. When Vicki isn't petting her cat, she’s throwing a ball for her dogs.
Updated on ・1 min read

If coding tutorials with math examples are the bane of your existence, keep reading. This series uses relatable examples like dogs and cats.


Builtin Functions

print("words")
>>> words
Enter fullscreen mode Exit fullscreen mode
min(10, 20, 30, 40)
>>> 10
Enter fullscreen mode Exit fullscreen mode
max(10, 20, 30, 40)
>>> 40
Enter fullscreen mode Exit fullscreen mode
sum([10, 20, 30, 40])
>>> 100
Enter fullscreen mode Exit fullscreen mode

Variables

  • must start with a letter or underscore
  • cannot start with a number
  • only contain letters, numbers, and underscores
  • case-sensitive

Series based on

Discussion (0)