323人加入学习
(2人评价)
Python零基础入门学习2020最新版(SiKi)

使用Python3.8 于2019/10/20开始录制

价格 免费
该课程属于 Python人工智能 - A计划(永久有效期) 请加入后再学习
print("Hello Wrold!")
print('Hello Wrold!')

# "" '' 的使用,转义字符\输出;从第一个引号开始到第二个引号结束
print("I'm fine!")
print('I\'m fine!')   #I'm fine!

# title()函数 大写英文句子每个单词的首字母
msg = "Would you want to have a drink?"
msgA = msg.title()
print(msg)        #Would you want to have a drink?
print(msgA)       #Would You Want To Have A Drink?

# upper()函数 大写英文句子所有字母
msgAll_A = msg.upper()
print(msgAll_A)    #WOULD YOU WANT TO HAVE A DRINK?

# lower()函数 小写英文句子所有字母
msgAll_a = msg.lower()
print(msgAll_a)    #would you want to have a drink?

# len()函数 获取字符串长度
length = len(msg)
print(length)      #31    #空格也算字符

 

[展开全文]