FullStackPark / IPS-Lesson

IPS Lession
1 stars 3 forks source link

Python 中的数 #4

Open FullStackPark-Admin opened 6 years ago

FullStackPark-Admin commented 6 years ago

intA = 10;
intB = -10;

floatA = 1.23;
floatB = -1.23;

intC = 0xff00;
intD = 0xa5b4c3d2;

# 1.23*10的9次方
floatC = 1.23e9;

# 0.000012
floatD = 1.2e-5;

# 注意注意注意注意注意注意
# 整数在 Python 中运算是精确的.
# 浮点数在 Python 中是有误差的.

print(123456789+987654321)

print(1.23456789-9.87654321)

print(1.0-0.000000000000000000001)

print(10/3)

# 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 
zhouhongxu commented 6 years ago

...Python

注意注意注意注意注意注意

整数在 Python 中运算是精确的.

浮点数在 Python 中是有误差的.

print(123456789+987654321)

print(1.23456789-9.87654321)

print(1.0-0.000000000000000000001)

print(10/3)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

...

zhouhongxu commented 6 years ago

1

zhouhongxu commented 6 years ago

...python

Good Afternoon ,your balance

*,下午好,你的账户余额**

Good afternoon %name,your balance %balance

%name,下午好,您的账户余额%balance

print('Hello,%s'% 'world') print('The brown %s jumps over the lazy dog '%'fox') classmates=['sunrui','wangying'] length=len(classmates); print(length)

zhouhongxu commented 6 years ago

···python

Good Afternoon ,your balance

*,下午好,你的账户余额**

Good afternoon %name,your balance %balance

%name,下午好,您的账户余额%balance

print('Hello,%s'% 'world') print('The brown %s jumps over the lazy dog '%'fox') classmates=['sunrui','wangying'] length=len(classmates);

print(length) ···

zhouhongxu commented 6 years ago

···python

1.声明了一个变量,名字叫classmates

2.声明了一个list

3.把list赋值给了classmates

classmates=['sunrui','wangying']

1.声明了一个变量length

2.通过函数len获取到classmates的长度

3.将2赋值给了1

length=len(classmates); print(length) ···