H
H
Heonir2021-06-14 14:09:34
Python
Heonir, 2021-06-14 14:09:34

What is wrong with my code?

Add the code so that your program prints the phrase Hello, Alina, I'm Anfisa!

friends = ['Sergey', 'Sonya', 'Dima', 'Alina', 'Egor']
index = print(friends[3])
print('Hi, ' + friends[index] + ', I'm Anfisa!' )

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladislav Lyskov, 2021-06-14
@Vlatqa

index = friends[3]
print('Hi, ' + index + ', I'm Anfisa!')

S
Stefan, 2021-06-14
@MEDIOFF

print("Привет, Алина, я Анфиса!")
And if you didn’t mean to add, but to rewrite so that everything would work, and we didn’t guess what you meant, then like this

friends = ['Сергей', 'Соня', 'Дима', 'Алина', 'Егор']
index = 3
print('Привет,  ' + friends[index] + ',  я Анфиса!')

V
VictorSeverlock, 2021-06-15
@VictorSeverlock

friends = ['Sergey', 'Sonya', 'Dima', 'Alina', 'Egor']
print(f'Hi, {friends[3]}, I'm Anfisa!')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question