- Write your code, so you don't have duplicated lines or whole blocks of code.
Good example:
if "cat" in animal_list:
print("found")
else:
print("not found")
print("the end")
Bad example:
if "cat" in animal_list:
print("found")
print("the end")
else:
print("not found")
print("the end")
- Pay attention to avoid code duplication by using classes and functions
- Use descriptive and correct variable names.
Good example:
with open("some_config_file.json", "r") as config:
pass
Bad example:
with open("some_config_file.json", "r") as scf:
pass
-
Use one style of quotes in your code. Double quotes are preferable.
-
Make sure that yor architecture is clear and your code is readable.
-
Make sure you write the correct path to the JSON file.
-
Make sure you use exactly
import datetime
, not the other way of import.
Add comments, prints, and functions to check your solution when you write your code. Don't forget to delete them when you are ready to commit and push your code.