CSDN day1 python_learn for mofan

day 1

I am preparing for the national examination for postgraduate.

import

other model

import time
print(time.localtime())

import time as t
print(t.localtime())

from time import time,localtime
print(localtime())
print(time)
#only use two easy function of this model
from time import*
print(time())
#use all of the model 

write my own model

#how to make my model
#you can also put it in site-passage.It will be used as local model.
#def our function in our model
def printdata(data):
    print(data)
    
#make sure that M1 and P1 in the same location
import M1
M1.printdata('JC fighting')

break or continue

a=True
while a:
    b=input('type something')
    if b=='1':
        a=False
    elif b=='2':
        a=False
    else:
        pass
#'pass' mean do nothing


#there is a difference between continue and break
#example:
a=True
while a:
    b=input('type a number')
    if b==1:
        #break
        #break will break this loop and do the next programe 
        continue
        #this continue will let this circulation do again
        a=False
    else:
        print('type another number')
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值