Another episode of read the fucking manual
in the code for middle_word, task 7 0x00-python-hello_world
instruction was "middle_word should contain the value of the variable word without the first and last letters" I hard coded my program to be static instead of been dynamic(ie been able to work for many inputs)
string given to us was "Holberton"
My code for middle_wordmiddle_word = word[1:8]
The right code:
middle_word = word[1:-1]
like what if alx has used another input/strings to test my code, so thats why checker was flagging me wrong.
word[1:-1]
: this is called slicing in python and means to slice the word from the second letter(included) to the last letter(excluded).
python starts counting at index 0 so at index 1, letter will be 'o'
Output:olberto