# UPDATE ON WEEK SEVEN(7) OF MY SOFTWARE ENGINEERING JOURNEY AT BLOCKFUSE LABS
Our instructors are now taking us deep into it. we are now doing something tricky but simple that is the list data type, am gonna be writing some things about list data type below which i will start with what is a list:
#### LIST:
list is the collection of data in a particular order. to define a list you will enter the variable name then the assignment operator and to enter the value you will need to put it in a squer bracket. there a another way of defining a list again but that is usually used in converting a particuler data type to list and it is almost same thing with what we just look now but this is after the variable name and the assignment operator then you enter list() and the value of the list will be inside the bracket after the list.
The practical example:
```python
#example of a list
friut_name = ["orange", "apple", "mango"]
friut_name = list(("orange", "apple", "mango"))
```
the list() is mostly use to convert other data type to list so we will be focusing on the other method.
#### HOW TO ADD VALUE TO A LIST:
To add a value to a list you can used the .append method which by default will add the value at the end of the list. the practical example of how this works will be shown below:
```python
#we are to add banana to this list.
friut_name = ['orange', 'apple', 'mango']
friut_name = friut_name.append('banana')
```
You can also used the .insert method too which you can used it when you want to add to a particular location or lets say index and the one that was there already will move to the next index. example below:
```python
#we are to add banana in the first index.
friut_name = ['orange', 'apple', 'mango']
friut_name = friut_name.insert(0, banana)
```
#### HOW TO REMOVE A VALUE IN A LIST:
To remove a value in a list you can used the .remove() or you can also use the .pop() too and by default the .pop() will remove the last value in the list so you will have to specify the index you want to remove. practical example below:
```python
#we want to remove apple in the list using the .remove()
friut_name = ['orange', 'apple', 'mango']
friut_name = friut_name.remove('apple')
#you can do something like this too
friut_name = friut_name.remove(fruit_name[1])
#Now we will use the .pop() to remove same apple.
friut_name = ['orange', 'apple', 'mango']
friut_name = friut_name.pop(1)
```
#### HOW TO PRINT A LIST IN REVERSE:
To reverse a list is very simple too you will use the .reverse() method and it will authomatically reverse the list when you print it. lets see how it works below:
```python
#we want to print this list in reverse.
fruit_name = ['orange', 'apple', 'mango']
friut_name = friut_name.reverse()
print(friut_name)
#you can do something like this too and the output will be same:
friut_name = friut_name.sort(reverse=True)
#and the out put will be like:
['mango', 'apple', 'orange']
```
#### HOW TO ARRANGE A LIST IN ALPHABETICAL ORDER:
To arrange a list in alphabetical other you will use the .sort method and it when you print it will arrange it alphabetically from A-Z. lets look at the practical example:
```python
#we are to arrange the list in alphabetical order.
friut_name = ['orange', 'apple', 'mango']
print(friut_name)
#you can do something like this too:
friut_name = sorted(friut_name)
#expected output
['apple', 'mango', 'orrange']
'''
this is because in the aphabet A comes before M
and M comes before O
'''
```
#### IF LIST ARE NUMBERS YOU CAN FIND THE MAXIMUIM, MINIMUIM AND THE SUM TOO:
To find the maximium number you will used the max keyword to do that also for the minimuim you will use the min keyword and for the total you will use the sum keyword.lets look at how to do that below:
```python
#to find the biggest number
randomNumbers = [7, 5, 2, 9, 15]
print(max(randomNumber))
#to find the smallest number in the list
print(min(randomNumber))
#to find the total of the whole list
print(sum(randomNumber))
#expected output:
15
2
38
```
#### HOW TO FIND THE INDEX NUMBER OF A VALUE IN THE LIST:
To find the index number of a value you will use the .index() keyword. lets look at the example below:
```python
#we want to find the index of apple in the list
friut_name = ['orrange', 'apple', 'mango']
friut_name = friut_name.index('apple')
#expected output
1
```
#### HOW TO CHECK IF A VALUE IS IN THE LIST:
To check if a value is in a list you will use the 'in' keyword don't worry we gonna look at that and it always return a boolean value. example:
```python
#we want to check i apple is in the list friut_name
friut_name = ['orange', 'apple', 'mango']
print('apple' in friut_name)
#expected output
True
```
Their are many other things we look at this week Blockfuse labs is building us well is prepering us for the battle and we are getting cook already keep anticipating for my weekly update from blockfuse labs.
# NEVER SETTLE :100: