函数相关基础

今天在准备买房子,真的买不起呀
外地户口还限购
还限购
#重复表达加重语气





# 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:动态参数 可以接受多个按照位置传入的参数

猜你喜欢

转载自www.cnblogs.com/mini-c/p/9649466.html