if :
elif :
else :
print('{0} \n{1} \n{2}' .format((a + b), (a - b), (a * b)))
print(*[num**2 for num in range(n)], sep = '\n')
def f():
return condition # 直接返回判断的条件真或假
print(*range(1, int(input())+1), sep= '')
x, y, z, n = (int(input()) for _ in range(4))
print ([a, b, c] for a in range(0, x+1) for b in range(0, y+1) for c in range(0, z+1) if a + b + c != n])
i = int(input())
lis = list(map(int,raw_input().strip().split()))[:i]
z = max(lis)
while max(lis) == z:
lis.remove(max(lis)) print max(lis)
n = int(input())
marksheet = [[input(), float(input())] for _ in range(n)]
second_highest = sorted(list(set([marks for name, marks in marksheet])))[1]
print('\n'.join([a for a,b in sorted(marksheet) if b == second_highest]))
if __name__ == '__main__':
n = int(input())
student_marks = {}
for _ in range(n):
name, *line = input().split()
scores = list(map(float, line))
student_marks[name] = scores
query_name = input()
query_scores = student_marks[query_name]
print("{0:.2f}".format(sum(query_scores) / (len(query_scores))))
L = []
for _ in range(0, int(input())):
user_input = input().split(' ')
command = user_input.pop(0)
if len(user_input) > 0:
if 'insert' == command:
eval("L.{0}({1}, {2})".format(command, user_input[0], user_input[1]))
else:
eval("L.{0}({1})".format(command, user_input[0]))
elif command == 'print':
print(L)
else:
eval("L.{0}()".format(command))
# eval() 将insert, pop, print等str转换成命令字符,进行执行
print raw_input() == 0 or hash(tuple(map(int, raw_input().split(' '))))
def swap_case(s):
return s.swapcase() # 字母大小写转换函数 if __name__ == '__main__':
s = input()
result = swap_case(s)
print(result)
def split_and_join(line):
return "-".join(line.split(" ")) # 先分隔在用符号代替 if __name__ == '__main__':
line = input()
result = split_and_join(line)
print(result)
import sys
import xml.etree.ElementTree as etree def get_attr_number(node):
return sum([len(elem.items()) for elem in tree.iter()]) if __name__ == '__main__':
sys.stdin.readline()
xml = sys.stdin.read()
tree = etree.ElementTree(etree.fromstring(xml))
root = tree.getroot()
print(get_attr_number(root))
import xml.etree.ElementTree as etree

maxdepth = 0
def depth(elem, level):
global maxdepth
level += 1
if level >= maxdepth:
maxdepth = level
for child in elem:
depth(child, level)
if __name__ == '__main__':
n = int(input())
xml = ""
for i in range(n):
xml = xml + input() + "\n"
tree = etree.ElementTree(etree.fromstring(xml))
depth(tree.getroot(), -1)
print(maxdepth)
import re

n, m = map(int, input().split())
a, b = [], ""
for _ in range(n):
a.append(input()) for z in zip(*a):
b += "".join(z) print(re.sub(r"(?<=\w)([^\w]+)(?=\w)", " ", b))
import numpy as np
print(np.array(input().split(),int).reshape(3,3))
n, m = map(int, input().split())
array = numpy.array([input().strip().split() for _ in range(n)], int)
print (array.transpose())
print (array.flatten())
import numpy as np
a, b, c = map(int,input().split())
arrA = np.array([input().split() for _ in range(a)],int)
arrB = np.array([input().split() for _ in range(b)],int)
print(np.concatenate((arrA, arrB), axis = 0))

最新文章

  1. 关于数组Arry的一些基本认识
  2. Bootstrap系列 -- 11. 基础表单
  3. unicode可以通过编码(encode)成为特定编码的str
  4. MySQL系列:查看并修改当前数据库的编码
  5. protobuf安装
  6. SSH与EJB 比较
  7. JAVA输入/输出系统中的其他流学习笔记
  8. Python编码与变量
  9. HDMI驱动热插拔检测方法
  10. ABP之展现层(Datatables分页)
  11. 开源unittest测试报告源码BSTestRunner.py
  12. golang学习笔记18 用go语言编写移动端sdk和app开发gomobile
  13. adb 转自github https://github.com/mzlogin/awesome-adb
  14. 关于存session,cookie还是数据库或者memcache的优劣,部分网上抄录
  15. 关于vector变量的size,是一个无符号数引发的bug。LeetCode 3 sum
  16. 【51Nod】1055 最长等差数列 动态规划
  17. KONG基础使用
  18. redis的常用公共方法(2)
  19. my sql存储过程 基本使用
  20. 在Qt(C++)中使用QThread实现多线程

热门文章

  1. stty - 改变并打印终端行设置
  2. 前端学习(十二)js数据类型(笔记)
  3. JAVA练习01
  4. Sphinx + Read the docs theme
  5. concurrent=false/true的定时任务job策略介绍
  6. TCP三次挥手
  7. mongodb客户端操作常用命令(续)
  8. delphi 设备函数GetDeviceCaps函数
  9. 数字IT基础-数据采集总线
  10. (转)OpenFire源码学习之十三:消息处理