Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ## 1
- # text = "This is A STrinG with WEird Casess.."
- # print(text.lower())
- # print(text.upper())
- # print(text.swapcase())
- # ## 2
- # paragraph = "a bc d. ef gh ij. kl mn o. pqrs t"
- # print(paragraph.split())
- # sentence_list = paragraph.split(". ")
- # for s in sentence_list:
- # print(s)
- ## 3
- # w = input("Enter a word: ")
- word_string = "football"
- if word_string.count("o") == 2:
- print("valid spelling")
- else:
- print("check spelling")
- # word_list = list(word_string)
- # print(word_list)
- # for index in word_list:
- # ## c = o
- # index = "o".upper()
- # word_list => list
- # len(word_list) => number of characters in the word(list)
- # range(len(word_list)) = [0,1,2,3,4,5,6,7]
- # for index in range(len(word_list)):
- # if word_list[index] in "aeiou":
- # word_list[index] = word_list[index].upper()
- # else:
- # word_list[index] = word_list[index].lower()
- # word_string = "".join(word_list)
- # print(word_string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement