darlingmz
向前看,向前迈!

> 如果一个3位数等于其各位数字的立方和,则称这个数为水仙花数。 求1000以内的水仙花数(3位数)

```python
sxh = []
for i in range(100, 1000):
s = 0
m = list(str(i))
for j in m:
s += int(j)**len(m)
if i == s:
sxh.append(i)
print("100-999的水仙花数:%s" % sxh)

# 100-999的水仙花数:[153, 370, 370, 371, 407]
```

> append和extend的区别

```python
# append
a = [1,2,3,4,5]
c = [6,7]
a.append(c)
print(a)

# [1, 2, 3, 4, 5, [6, 7]]

# extend

a = [1,2,3,4,5]
c = [6,7]
a.extend(c)
print(a)

# [1, 2, 3, 4, 5, 6, 7]
```

> 目前测试都需要依赖登录,自动化中如何操作?

- 如果是接口自动化的话可以使用session进行保持会话,然后再执行登录后的操作
- 如果是web自动化的话可以进行定位输入账号密码完成登录
- 如果是app自动化的话可以进行定位账号密码输入完成登录

posted on 2022-02-21 22:37  darlingmz  阅读(46)  评论(0编辑  收藏  举报