Strings & Console Output


#1



4- access by index


First of all, the word does not even have a fifth letter: M(0) O(1) N(2) T(3) Y(4), and I've try every posible way of code. Please, help me!


fifth_letter = "MONTY" [5] = "Y"


#2

Please notice the diagram they gave you above where your coding:

+---+---+---+---+---+---+
| P | Y | T | H | O | N |
+---+---+---+---+---+---+
  0   1   2   3   4   5

Please also notice that it starts at zero so if you want the fifth letter you need 4. Monty is the same as Python in this sense so you need to use 4 instead of 5. Also, instead of equaling your whole thing to a letter your need to print your fifth_letter variable.


#3

2 posts were split to a new topic: Strings and console output


#7

2 posts were split to a new topic: Strings and console output


#8