print [[m + n + m for m in '123456789' for n in '0123456789']]
2019-08-05
对C语言挺熟悉的,也学过一点C++和Java,这是第一次接触Python,然而我居然倒在这么简单的一道题上,这表达也太简单了吧
2019-08-05
关于key不可变的理解:
想想考完试老师报成绩“王蛋蛋,59!”,你站起来说“老师,我刚刚改名了,就在你报成绩的前一秒!”
想想考完试老师报成绩“王蛋蛋,59!”,你站起来说“老师,我刚刚改名了,就在你报成绩的前一秒!”
2019-08-05
sum = 0
x = 1
n = 1
while True:
sum = sum + x
x = x * 2
if n >= 20:
break
else :
n = n + 1
print(sum)
x = 1
n = 1
while True:
sum = sum + x
x = x * 2
if n >= 20:
break
else :
n = n + 1
print(sum)
2019-08-05
最赞回答 / _____然
if 判断语句 可解释为如果x % 2 取余数 例如 5 % 2 等于 1x / 2 取商 例如 5 / 2 等于 2一般判断是否为奇偶数用x % 2因为偶数除以2不会有余数 奇数除以2总会余1
2019-08-05
不明白汉诺塔的同学们可以看看这个up主的视频
个人觉得讲解的很好
https://www.bilibili.com/video/av9830115?from=search&seid=15568989054584120663
个人觉得讲解的很好
https://www.bilibili.com/video/av9830115?from=search&seid=15568989054584120663
2019-08-05
x1 = 1
d = 3
n = 100
x100 = 100*3-2 #3n-2找出尾项
s = (1+x100) * 100/2 #(首项+尾项)*项数/2
print(s);
d = 3
n = 100
x100 = 100*3-2 #3n-2找出尾项
s = (1+x100) * 100/2 #(首项+尾项)*项数/2
print(s);
2019-08-05
x1 = 1
d = 3
n = 100
x100 = 100*3-2
s = (1+x100) * 100/2
print(s);
d = 3
n = 100
x100 = 100*3-2
s = (1+x100) * 100/2
print(s);
2019-08-05