文字变量的蟒蛇

代码示例

13
0

N

#Use f-string
#Example:

x = 2
y = f'This is a string using variable x: {x}'
print(y)

#Output: 
#This is a string using variable x: 2
2
0

N

x = 5
y = 10
x+y
#result = 15
1
0

N

var1 = “awesome”
var2 = “ever”
print “Codecademy has the most %s coding lessons %s!” % (var1, var2)
# displays: “Codecademy has the most awesome coding lessons ever!”

其他语言

此页面有其他语言版本

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................