PYTHON.
Задание 1
Вы находитесь в квест-комнате по мультфильму WALL-E!
Чтобы выбраться из комнаты, необходимо выполнить такие шаги:
1. Узнайте длину строки s приведенного текста и выведите это значение в консоль.
2. Выведите весь текст в нижнем регистре.
3. Кто-то допустил ошибку и некорректно написал имя робота WALL-E! Замените все вхождения слова WALLE на WALL-E.
4. Наконец, подсчитайте, сколько раз в тексте было использовано слово Earth. Код к заданию 1:
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 \
2
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."
# Step 1 len()
# Step 2 ?.upper()
# Step 3 ?.replace(*, *, *)
# Step 4 ?.count()
Задание 2 Напишите программу, которая позволит проверять пароль на сложность. Воспользуйтесь строковыми методами, описанными в разделе 4.7.1. String Methods (https://docs.python. org/3.6/library/stdtypes.html#str.isupper). Проверку пароля следует проводить по таким критериям: 1. Длина: от 5 символов. 2. Буквы латинского алфавита в верхнем и нижнем регистре: A, a, Z, z.
Dear Alex,
How are you? I am in the capital of England — in London. My parents and I always dreamt about seeing this nice city.
There are a lot of beautiful old buildings. We have alredy seen Westminster Abbey, Big Ben (now it called Elizabeth’s Tower), The Houses of Parliament, Buckingham Palace, St. Paul’s Cathedral, London Bridge, The Tower of london and The Waxworks Madame Tussaunds Museum. There are the models of famous people from pop stars to prime ministers made from wax in this museum. They look like real. It’s so interesting.
My parents and I are walking on Trafalgar Square now. There is Nelson’s Column in its centre which is guarded by four lion statues at its base. By the way, I sent you this postcard with a picture of Trafalgar Square.
The weather is not fine today, it’s foggy and rainy. But it doesn’t spoil our walking.
We took much photos. Next week we will be at home and I’ll show you them.
Don’t miss the chance to visit England and London.
Best wishes,
Maria