Предмет: Информатика, автор: guruikiki

7. Що буде надруковано в результаті виконання операторів?
s = 'spam'
s1 = ''
for i in s:
s1 = s1+i*4
рrint(s1)
8. Визначте довжину рядка:
a = 'Оператор добування зрізу'
len(a)
print(len(a))

Ответы

Автор ответа: valgrisa
1

Ответ:

7. ssssppppaaaammmm

8. 24

Объяснение:

7.

с использованием цикла for (for i in s:) перебираются все символы строки s и каждый символ добавляется к строке s1 после его повторения 4 раза (s1 = s1 + i*4)

8. функция len() - возвращает длину (количество символов) строки

Интересные вопросы
Предмет: Английский язык, автор: Аноним
Reading task 1. Read the text and are the sentences true or false? Hello. My name is Dan Singer and I am learning how to make clothes because I think that men's clothes in shops are so boring. The ones you can buy in my town are always grey or black and I prefer bright colours. I started learning three years ago. The first thing I made for myself was a pair of pyjamas because I was cold at night. After that I started to make more difficult things like jeans. At first, I made a mistake and the legs were too long. I had to change them a few times but now they are perfect! Some people say it is cheaper to make your own clothes but actually I don't think it is. Many shops sell shirts which were made in factories in other countries and they don't cost much. When you make clothes, you have to buy things like a sewing machine and that can be expensive. I can work faster now than when I started, but it still takes about a month to finish big things like a coat or a jacket. My latest project is a dress for my wife. I've nearly completed it. It's a surprise for her birthday and I hope she doesn't find out. I'm making the dress out of wool because I think she needs a warm one for winter. Dan likes to go shopping for clothes 1. 2. Dan likes wearing dark clothes 3. Dan thinks that pyjamas are easier to make than jeans 4. Dan's jeans are the right size 5. Dan says that making clothes is cheap 6. Dan needs several weeks to make a coat. 7. Dan has finished a dress for his wife 8. Dan's wife asked him to make a warm dress​