摘要:# author: Roy.G'''x=lambda x,y:x**3+y**3a=x(3,3)print(a)'''# def a(a):# a=2*a# a=b(a) # this b(a) just is a str ,not a function ,so it has no problem#
阅读全文
摘要:author: Roy.G 20211230import sysimport sysimport mathimport matplotlib.pyplot as plt'''def fun_1(): print("fun_1") return 1def fun_2(): print("fun_1")
阅读全文
摘要:# author: Roy.G 20211230import sysimport timeimport math'''def fun_1(): print("fun_1") return 1def fun_2(): print("fun_1")x=fun_1()y=fun_2()print(x)pr
阅读全文
摘要:s=u"你好"print(s)print(s.encode().decode("gbk"))
阅读全文
摘要:# author: Roy.Gimport wsgiref.handlers'''data=open("file_1.txt",encoding="utf-8")print(data)print(data.read())print(" ")print(data.read()) # cursor is
阅读全文
摘要:# author: Roy.Glist_1=[1,2,3,4,5,6,7,7,7,7,7,7,8,]set_1=set(list_1) #change list to setset_2={1,2,3,4,6,7,8,9,10}print(list_1,type(list_1))print(" ")p
阅读全文
摘要:# author: Roy.Ginfo={"1":"a", "2":"b", "3":"c", "4":"d", "5":"e",}print(info)print(info["1"])info["1"]="wusong"print(info["1"])info["7"]="luzhish
阅读全文
摘要:# author: Roy.Ga="my name is \t roy.guo,i am {year} years old,i like {frute}"print(a.center(60,"-")) # .center print 50 character,center the string an
阅读全文
摘要:# author: Roy.Gage_of_oldboy = 56count = 0while count<3: if count==3: break guess_age=int( input ("guess age:")) if guess_age == age_of_oldboy: print(
阅读全文
摘要:# author: Roy.Gshopping_cart=[]salery=input("salery is :")item_list=[ ("a",500), ("b",600), ("b",700), ("d",800), ("e",900), ("f",1000), ("g",1100), (
阅读全文
摘要:# author: Roy.Ga=[1,2,3,4,5,6]b=enumerate(a)print(a)for i in b: print(i)# enumerate 好像是将原来的数组的序号,记录在了一块内存中,而元素定义成序号加元素 的形式,当调用他时,只能逐项取出元素,因为,b=enmumer
阅读全文