python基础
import math
dir(math)
list[]
tuple()
dict{}
set
a1=[1,4,9]
type(a1)
a2=(2,5,8)
type(a2)
a3={"john":170,"dick":180,"jane":165}
type(a3)
a1=[1,4,9]
type(a1)
a1._len_
a1._str_
a1._class_
a1.reverse()
b1=np.array([1,2],[3,4])
np.sum(b1)
b1.sum()
if:
else:
第一次作业
3+5
from math import *
cos(3)
a1=[1,4,9]
a2=(2,5,8)
a3={"john":170,"dick":180,"jane":165}
type(a1)
dir(a1)
type(a2)
dir(a2)
type(a3)
dir(a3)
sum=0
for i in range(1,101):
sum=sum+i
print(sum)
a=int(input('请输入一个数'))
if a>=0:
print(sqrt(a))
else:
print("False")
import numpy as np
c=np.array((1,2,3))
c.sum()
np.sum(c)
def jiecheng(x):
y=1
i=1
while i<=x:
y=y*i
i=i+1
return(y)
m=jiecheng(5);m