a,b=[0]*10,[False]*10
i=0
while i<=9:
if not b[r]:
a[i]=r
i=i+1
print(a)
则划线处的代码依次是( )
① r=random.randint(0,10)
② b[r]=True
③import random
④ b[i]=True
⑤from random import randint
⑥ r=random.randint(0,9)
| ⒈#绘制正弦函数y=sin(x)的图像 ⒉import matplotlib. pyplot as plt ⒊import numpy as np ⒋x=np. linspace(0,10,1000) ⒌y=np. sin(x) ⒍ ⒎plt show( ) |
import numpy as np #加载numpy模块并取名为np
import matplotlib.pyplot as plt
x=np.arange(0,2*np.pi,0.01)
y=np.sin(x)
plt.plot(x,y)
plt.title('sin(x)')
plt.xlabel('X')
plt.ylabel('Y')
plt.show()
下列选择错误的是( )
提示:让海龟前进10单位,turtle.forward(10)
让海龟左转45度,turtle.left(45)
让海龟右转90度,turtle.right(90)
>>> sqrt(2)
B . >>> from math improt sqrt>>> sqrt(2)
C . >>> import math>>> math.pow(2,0.5)
D . >>> from math import pow>>> pow(2,0.5)