Mai The Dung
Mai The Dung
Resume
999 Python Super Tips (8 → 18)
999 Python Super Tips (8 → 18)

999 Python Super Tips (8 → 18)

Tags
Python
Published
November 12, 2022
Author
Mai The Dung

8. Enumerate related items of the same concept via Enum

An Enum is a set of symbolic names bound to unique values. They are similar to global variables, but they offer a more useful repr(), grouping, type-safety, and a few other features.
notion image

9. Repeat strings without looping

notion image

10. Compare 3 numbers just like in Math

notion image

11. Merge dictionaries in a single readable line

notion image

12. Find the index of an element in a tuple

notion image

13. Convert a string into a list of strings

notion image

14. Avoid “trivial” mistakes by using named parameters

notion image

15. Print multiple elements with a single print() statement

notion image

16. Print multiple elements in the same line

notion image

17. Print multiple values with a custom separator in between each value

notion image

18. You cannot use a number at the beginning of the name of a variable

notion image
Table of Contents
8. Enumerate related items of the same concept via Enum9. Repeat strings without looping10. Compare 3 numbers just like in Math11. Merge dictionaries in a single readable line12. Find the index of an element in a tuple13. Convert a string into a list of strings14. Avoid “trivial” mistakes by using named parameters15. Print multiple elements with a single print() statement16. Print multiple elements in the same line17. Print multiple values with a custom separator in between each value18. You cannot use a number at the beginning of the name of a variable
Copyright 2022 Mai The Dung