1#module names are lowercase
2import mymodule
3
4#variable names, function names, and parameter names are snake case
5my_variable = 27
6def my_function(my_parameter):
7 print(my_parameter)
8
9#constants are uppercase
10MY_CONSTANT = 27
11
12#classes are pascalcase
13class MyClass:
14 pass
1################################################################################
2#IN COMMENTS
3################################################################################
4
5# module/file names should be in lowercase (ALL LETTERS)
6# example: import mymodule OR import myfile
7
8# ------------------------------------------------------------------------------
9
10# variable/parameter names should use snake case
11
12# (means separate words by '_' (underscore))
13# example: this_is_a_variable: int = 5 (: int, represents data type)
14# example 2: this_is_a_parameter: str = 'A String'
15
16# ------------------------------------------------------------------------------
17
18# functions: same as variables and parameters
19
20# ------------------------------------------------------------------------------
21
22# classes, uses CamelCase, First letter of each word should be Capital
23# example:
24# class AClassOk:
25# def __init__(self):
26# pass
27
28# ------------------------------------------------------------------------------
29
30# Constants: ALL LETTERS SHOULD BE CAPITAL, WORDS SEPERATED BY '_'(UNDERSCORE).
31# CONST = "OOF"
32
33###############################################################################
34# IN REAL LIFE
35###############################################################################
36
37import amodule
38
39a_var: float = 3.1
40
41def eat_burger(a_parameter):
42 print(a_parameter)
43
44class EatCocaCola:
45 def __init__(self):
46 pass
47
48A_CONST: bool = False
49