1:s = ('short, you need Python')
print('life is {}'.format(s))
print('life is {s}'.format(s = 'short, you need Python'))
print('life is {}'.format(s))
print('life is {s}'.format(s = 'short, you need Python'))
8小时前
print(r'''\"To be, or not to be\": that is the question.
\nWhether it\'s nobler in the mind to suffer.''')
\nWhether it\'s nobler in the mind to suffer.''')
8小时前
C = 3.14 #C的意思是长
K = 1.57 #K的意思是宽
S = C * K #S的意思是面积
print(S)
print(round(S, 2))
K = 1.57 #K的意思是宽
S = C * K #S的意思是面积
print(S)
print(round(S, 2))
11小时前
Python 内建的关键字太多太乱了,一会儿 add 一会儿 append,remove 和 pop。就不能统一下吗?感觉很乱。。。
2024-04-30
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49
}
print('Alice old score is {}'.format(d['Alice']))
d['Alice']=60
print(d)
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49
}
print('Alice old score is {}'.format(d['Alice']))
d['Alice']=60
print(d)
2024-04-16
length=3.14
wide=1.57
aire=3.14×1.57
aire=round(aire,2)
wide=1.57
aire=3.14×1.57
aire=round(aire,2)
2024-04-14
a='Hello Wold'
b='Hello Wold'
c='Hello Wold'
print(a)
print(b)
print(c)
b='Hello Wold'
c='Hello Wold'
print(a)
print(b)
print(c)
2024-04-13
sum = 0
num = 0
while num <= 1000:
if num % 2 != 0:
num += 1
continue
sum += num
num += 2
print(sum)
num = 0
while num <= 1000:
if num % 2 != 0:
num += 1
continue
sum += num
num += 2
print(sum)
2024-04-07
sum = 0
num = 0
while True:
sum += num
num += 2
if num > 1000:
break
print(sum)
num = 0
while True:
sum += num
num += 2
if num > 1000:
break
print(sum)
2024-04-07