---
# System prepended metadata

title: WEEK 5

---

BLOCKFUSE LABS
WEEK FIVE REPORT
Python variables
I learnt how to declare variables and assign values to the created variable. 
Python variables begin with either letters or underscore “_” and follows a convention of snake case (eg. variable_name), camel case (eg. variableName) or Pascal case (eg. VariableName).
Declaring a variable is important as variable names are case sensitive (eg. variable_name is not the same as Variable_name).

Comments 
Comments are non-executables lines ususally written for the purpose of readability. It is important to write comments in programming to make your code readable and easily understandable by other people or even when you revisit your code after some time. The “#” symbol is used to comment a line (eg. #This is a comment) while a group of three single quote is used for multi-line comments. Eg
‘’’This is a comments
    This line of code will not be executed
     It is for readability
‘’’

Casting
I also learnt how to specify a type of data by casting. I learnt some types of data types namely; string, integer, and float.
The data type can be set using the constructor functions. 
Examples;
name=str(“John”)
age=int(34)
height=float(6.4)

Indexing
I learnt that strings are stored in array index, and the index can be either positive or negative. It is positive when moving from left to right and starts from index zero (0) and negative when moving from right to left (negative index starts with -1).
Slicing
I also learnt how to slice a string by specifying the start and stop index separated by a colon.
greet= “Hello World”
print(greet[0:5])
This will print Hello
The character at the stop index (5) will be excluded.

.split()
The .spli() method is used to split a string into a list. This splitting can be done using either empty space (default) or a common character which can serve as the separator.
len()
The len() method is used to get the length of a string. eg. 
var= “python”
print(len(var))
This will print the length of the word “python” which is 6.

I learnt a lot of other concepts. Overall, it was an amazing week at Blockfuse labs.