---
# System prepended metadata

title: Week FIVE at Blockfuse. The python String manipulation.

---

# Week FIVE at Blockfuse. The python String manipulation.

During out just concluded week at blockfuse labs, we learnt a lot on strings manipulation and how the are represented, stored and executed using the print function. Strings as a data type in python is an inportant part of the language it self as it has to store informations for the user and the computer. 

We looked as python string division, that is dividing a string into two equal parts eg
```
word = "pythonista"
word_divide = len(word) \\ 2
first_half = word[:word_divide]
second_half = word[word_divide:]
print(first_half)
print(second_half)
```

The above code outs first half as "python" and second half as "nista". This is a great example in how to get the halves of a word or string in python. 

We went on to look at indexing and slicing in python. Indexing of a string in python can we seen as the way of printing out a particular letter of a string stored in a variable. Let's check a quick example to see how this works. 
```
word = "python"
print(word[0])

outputs

p
```

Indexing starts from the left to the right in a positive order from zero(0) to the end of the word and from negative from right to left.

String slicing on the other hand can be seen as printing out a particular word and slicing the rest out. In string slicing, we have three ways to go about it
1. The start
2. The stop
3. The end
The helps on choosing where we start slicing from and where to stop and how many steps it should take
A quick example should help.
```
word = "pythonista"
print(word[0:10:2])
```

This starts from p to the end but jumps two steps each leaving some letters out.

Week five in a nutshell was a great learning experience for us as our instructors doubled down on more concepts and tasks to further improve our understanding of the concepts been taught in class. It was fun and challenge pack for us and we look further going into week six.
