首页 > 其他 > 详细

函数相关基础

时间:2018-09-14 23:34:09      阅读:154      评论:0      收藏:0      [点我收藏+]
今天在准备买房子,真的买不起呀
外地户口还限购
还限购
#重复表达加重语气





# s = ‘aaaabcc‘
# print(s.rjust(5,"#"))
# print(s.center(5,"s"))
# print(s.rstrip("b"))
# list1 = [1,2,3,4,5,6]
# list2 = list1.copy()
# print(list2)
# print(id(list1),id(list2))
# list1.insert(2,9)
# print(list1)

# with open(‘d‘,encoding="utf=8") as f,open("d.bak",‘w‘,encoding =‘utf-8‘) as f2:
# for line in f:
# if ‘a‘in line:
# line = line.replace(‘a‘,"b")
# f2.write(line)
# import os
# os.remove(‘d‘)
# os.rename(‘d.bak‘,‘d‘)
# def func():
# i = [‘帅‘,‘不帅‘]
# for i in i:
# print(i)
# if i == "帅":
# return None
# print(‘-‘)
# ret = func()
# print(ret)
# def f():
# return("haha")
# ret = f()
# print(f())
# def f(a)
# return (‘haha‘)
# 形参定义函数时候
# 实参调用函数时候用
# 按照位置传参数
# 按照关键字传参数
# 混合使用可以,但是位置参数必须在关键字之前
# *args:动态参数 可以接受多个按照位置传入的参数

函数相关基础

原文:https://www.cnblogs.com/mini-c/p/9649466.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!