day 1 Python 学习笔记

Python 入门:
 1. from numpy import *
python 【注意缩进】
外部输入: 变量名=int(input(''))

整段注释 """ """ 【注意对齐】

【range:】
  for i in range(0,4):   0,1,2,3

  for i in range(3)   0 , 1, 2

【print】
print ("the answer is" ,fib(10))
print("%d*%d=%d" % (i,j,i*j))

>>> print('''line1
... line2
... line3'''
)
line1
line2
line3


【time】
import time
time.sleep(1)

【append】
l.append(x)

【error】
1.invalid syntax  ------ print 无括号  (2 VS 3)
2. expected an indented block ------ 缩进

 

猜你喜欢

转载自blog.csdn.net/weixin_41632154/article/details/80167094