【log3】变量和简单数据类型3

No.

Error

Correction

Notes

1

a=” python ”

print(a.strip())

a=" python "

a=a.strip()

print(a)

.strip()暂时删除前后空白;

将新值重新赋给原来的变量

2

Print(“Albert Einstein once said, ‘A person who never made a mistake never

tried anything new.’”)

Print(‘Albert Einstein once said, “A person who never made a mistake never

tried anything new.”’)

在Python中,字符串可以使用单引号或双引号来创建

使用‘’来输出含有“”的字符串

1.删除空白 剥除函数 .strip()

1.1删除左空白 .lstrip()

1.2删除右空白 .rstrip()

2.四则运算

2.1加减乘除乘方+-*/**

2.1运算顺序 ()优先 

你可能感兴趣的:(log,python)