python自学:正在学习class,之前还有一些,因为不知道注释功能,写完就删除了
'''
a={"aaa":"asd",
"bbb":"zxc"
}
print(a)
a['aaa']="aaaaaaaaaaaaaaaaaaaaaaaaa"
print(a)
a["ccc"]="csdn"
print(a)
del a["aaa"]
print(a)
for key in a.values():
print("\nKey: " + key)
a={ "aaa":"asd",
"bbb":"zxce",
"ccc":"qwert",
"ddd":"asd",
"eee":"qwer",
"fff":"asd"
}
print(set(a.values()))
a={'qs':'qw','qss':'qwe'}
b={'qqs':'qqw','qqss':'qqqwe'}
c={'qqqs':'qqqw','qqqss':'qqqqwe'}
d=[a,b,c]
print(d)
'''
'''
a=input("please")
print(int(a)**99999)
name=input()
print("\nhellow "+name)
age=int(input())
print(age)
if age<18:
print("ee")
else:
print("ww")
'''
'''
a=1
while a<=10:
print(a)
a=a+1
'''
"""
prompt = "\nTell me something, and I will repeat it back to you:"
prompt += "\nEnter 'quit' to end the program. "
message = ""
while message:
message = input(prompt)
print(message)
"""
'''
current_number = 0
while current_number < 10:
current_number += 1
if current_number % 2 == 0:
continue
print(current_number)
'''
"""
numbers=int(input("please tell me numbers"))
much=0
while numbers>0:
age = int(input("please tell me you age"))
if age<3:
print("free")
elif age<12:
print("10 dolles")
much += 10
else:
print("15 dolles")
much += 15
numbers-=1
if much==0:
print(free)
else:
print (much)
"""#购票系统
"""
def a():
print("hellow")
a()
"""#一个最简单的函数
'''
def a(name):
print("hellow "+name.title())
a(input())
'''#一个可以有输入功能的函数
'''
def a(w):
w=int(input())
return w
def b(y):
z = int(input())
return z
return 2
def c(z):
z = int(input())
return z
return 3
def main(s,d,f):
return a(s)+b(d)+c(f)
print (main(1,1,1))
'''#用函数实现加减法,return的简单应用
'''
def build_person(first_name, last_name):
person = {'first': first_name, 'last': last_name}
return person
a=input()
b=input()
musician = build_person(a, b)
print(musician)
'''#字典与函数的简单应用
'''
n=int(input())
i=0
det=[]
print(str(n))
while(i<n):
ii=0
c=[]
while(ii<n):
a=int(input())
c.append(a)
ii+=1
det.append(c)
i+=1
#行列式的输入
for each in det:
print(each)
print(det[0][0])
'''