Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = 'In a distant, but not so unrealistic, future \
- where mankind has abandoned earth because it has \
- become covered with trash from products sold by \
- the powerful multi-national Buy N Large corporation, \
- WALLE, a garbage collecting robot has been left to \
- clean up the mess. Mesmerized with trinkets of Earth’s \
- history and show tunes, WALLE is alone on Earth except \
- for a sprightly pet cockroach. One day, EVE, a sleek \
- (and dangerous) reconnaissance robot, is sent to Earth to \
- find proof that life is once again sustainable.'
- # длина текст
- print(len(s))
- # текст в нижнем регистре
- print(s.lower())
- # Замените все вхождения слова WALLE на WALL-E
- print(s.replace('WALLE', 'WALL-E'))
- # подсчитайте, сколько раз в тексте было использовано слово Earth
- count = 0
- for i in s.split(' '):
- if 'Earth' in i:
- count += 1
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement