Telegram Group & Telegram Channel
Что выведет этот код?

Ответ: 1.

Потому что все строки-литералы разделенные любым количеством пробелов соединяются в одну.

То есть:

"Hello" "World"
то же самое, что и "HelloWorld"


Это работает и с одинарными, двойными, тройными кавычками.

x = 'One' "Two" '''Three'''

print(x)
# OneTwoThree

Однако это работает только с литералами.

s1 = "String1"
s2 = "String2"

print(s1 s2)
# SyntaxError: invalid syntax.

В итоге у нас список из одного элемента:

["AppleBananaOrangePineapple"]

#strings #строки



tg-me.com/pythrone/8
Create:
Last Update:

Что выведет этот код?

Ответ: 1.

Потому что все строки-литералы разделенные любым количеством пробелов соединяются в одну.

То есть:

"Hello" "World"
то же самое, что и "HelloWorld"


Это работает и с одинарными, двойными, тройными кавычками.

x = 'One' "Two" '''Three'''

print(x)
# OneTwoThree

Однако это работает только с литералами.

s1 = "String1"
s2 = "String2"

print(s1 s2)
# SyntaxError: invalid syntax.

В итоге у нас список из одного элемента:

["AppleBananaOrangePineapple"]

#strings #строки

BY PyThrone




Share with your friend now:
tg-me.com/pythrone/8

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

Launched in 2013, Telegram allows users to broadcast messages to a following via “channels”, or create public and private groups that are simple for others to access. Users can also send and receive large data files, including text and zip files, directly via the app.The platform said it has more than 500m active users, and topped 1bn downloads in August, according to data from SensorTower.

A project of our size needs at least a few hundred million dollars per year to keep going,” Mr. Durov wrote in his public channel on Telegram late last year. “While doing that, we will remain independent and stay true to our values, redefining how a tech company should operate.

telegram from tw


Telegram PyThrone
FROM USA