摘要:
x = 0 y = 0 def f(): x = 1 y = 1 class C: print(x, y) x = 2 f() # 0 1 Python解释器首先会在类C中寻找有无变量x的定义,发现没有后,就直接跳转到全局变量中,发现了有全局的变量x,则就调用了全局的变量x,而对于变量y而言,首先在 阅读全文
摘要:
题目:Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partition 阅读全文
摘要:
##1.将列表中的所有元素组合成字符串 a = ["Python", "is", "awesome"] print(" ",join(a)) ##2.查找列表中频率最高的值 # most frequent element in a list a = [1, 2, 3, 1, 2, 3, 2, 2, 阅读全文