python学习 Day02
字符串的使用
str1
= "Hello, World"
str2
= 'caozhanxiang'
str3
= '''Hi
Hi'''
print(str3
)
print(str1
[0])
print(str1
[0:])
print(str1
[0: -1])
str4
= "\""
str5
= "I'm"
print(r
"***\n***")
print(str1
* 3)
print(str1
+ str2
)
print("衬衫的价格为%d磅%s便士" % (9, "15"))
a
= 9
b
= "15"
print(f
"衬衫的价格为{a}磅{b}便士")
转载请注明原文地址:https://ipadbbs.8miu.com/read-52844.html