Что не так? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Что не так?

Не могу понять что не так country = "Russia" city = "Moscow" street = "K" home = "N" print(country + city + street + " street" + home + " home") Консоль выдаёт RussiaMoscowK streetN home, почему тут нет пробелов между словами кроме тех, где я в кавычках поставила? Пробовала поставить и перед variables, но это ничего не меняет в отображении. Как сделать так, чтобы выдавало Russia Moscow K street N home?

12th Feb 2023, 3:26 PM
Александра Бондаренко
Александра Бондаренко - avatar
4 Answers
+ 2
If the value is a string e.g, it is wrapped in quotes -> 'hi_there!' or "hi_there!" then it is meant to be displayed as it is, with underscores.
12th Feb 2023, 3:52 PM
Ipang
+ 1
country = "Russia" city = "Moscow" street = "K" home = "N" print(country, city, street, "street", home, "home") Use comma between the values when calling print()
12th Feb 2023, 3:36 PM
Ipang
+ 1
Ipang thank you so much! By the way, I’ve seen that sometimes there are used underlines like print(hi_there!) When do I need to use underlines?
12th Feb 2023, 3:47 PM
Александра Бондаренко
Александра Бондаренко - avatar
+ 1
Ipang Oh, I see. Thanks!!^^
12th Feb 2023, 4:59 PM
Александра Бондаренко
Александра Бондаренко - avatar