Generally We have the following Naming Conventions
Pascal Casing
MyList
YourListItem
Camel Casing
myList
yourListItem
Snake Casing
my_list
your_list_item
In python to Name variables we use snake casing
Note: When naming variable prefer readable name
prefer
remaider = 0 over r = 0
index = 0 over i = 0
Python Program Execution (Introduction) & Debugging using Visual Studio Code
Python executes the instructions line by line.
Using Visual Studio Code we can take control of execution of python program.
We need to define a break point which is a point from which we can execute the code
Now use the Run -> Start Debugging Option
As of now we have looked into
Toggle Breakpoint -> F9
Start Debugging -> F5
Step Over -> F10
Indentation in Python
Indentation is an extermely important concept of python because without proper indendation the Python code will not execute
In simple terms indendtation refers to whitespaces before a statement.
All the code in python block will generally have four spaces to start the statements
for index in range(10, 1000):
for prime_index in range(2,index):
if index%prime_index == 0:
print(f"{index} is not prime")
break
else:
print(f"{index} is prime")