摘要:
1.*args args是非关键字参数,可以理解为形参,为了方便记忆我理解它是arguments的缩写。 2.*kwargs kwargs是键值对参数,为了方便记忆我理解它是key word arguments的缩写。 3.setattr() set是设置,attr是属性,综合起来就是设置属性的函数 阅读全文
摘要:
数字转换成字符串: num=123 str='%d' %num str就变成了"123" 阅读全文
摘要:
返回真假时,需要为: return True return False 阅读全文
摘要:
Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thi 阅读全文
摘要:
排序并且改变自身结果: nums.sort() 阅读全文
摘要:
Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected e 阅读全文
摘要:
vector<int> v: 最大值: int max = *max_element(v.begin(),v.end()); 最小值: int min = *min_element(v.begin(),v.end()); 阅读全文
摘要:
Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equal, where a move is incrementing n 阅读全文
摘要:
A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 阅读全文
摘要:
定义一个字符串,求其长度: string str; str.length(); str.size(); 阅读全文
摘要:
头文件:<string> 转换函数:to_string(); 例如:int n=10; string str=to_string(n) ; 阅读全文