Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- phrase = "Giraffe Is Tall Enough!";
- print("Upper: " + phrase.upper());
- print(phrase.isupper());
- print(phrase.upper().isupper());
- print(len(phrase));
- print("First character: " + phrase[0]);
- print("Last character: " + phrase[-1]);
- print("Last character: " + phrase[len(phrase) - 1]);
- print(phrase.index("s"));
- print(phrase.index("Tal"));
- print(phrase.replace("Giraffe", "Elephant")); # Κάνει replace στο string phrase χωρίς να αλλάζει την τιμή του
- print(phrase + "\n");
- newPhrase = phrase.replace("Giraffe", "Elephant");
- print(newPhrase);
- print(len(newPhrase) - len(phrase));
- print(newPhrase.index("Ele"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement