中国大学MOOC: t=2020-02-29 15:48:10timestr = time.strptime(t, "%Y-%m-%d %H:%M:%S")print(time.strftime("%p %I:%M,%a,%b %d,%Y",timestr))
举一反三
- 以下程序中,运行结果是36的有()。 A: B: include <stdio.h> C: define M(y) y*y int main() { printf("%d ",M(6+0)); return 0; } D: E: include <stdio.h> F: define M(y) (y)*(y) int main() { printf("%d ",M(6+0)); return 0; } G: H: include <stdio.h> int M(int y) { return y*y; } int main() { printf("%d ",M(6+0)); return 0; } I: J: include <stdio.h> int M(int y) { return (y)*(y); } int main() { printf("%d ",M(6+0)); return 0; }
- 下面说法正确的是( )。知识点:列表->字符串 A: time = [23,59,59]print(":".join(time))的输出结果是23:59:59 B: time = ['23','59','59']print(":".join(time))的输出结果是23:59:59 C: time = ['23','59','59']t_str = ""for t in time: t_str += t+":"print(t_str)程序输出结果是23:59:59 D: time = [23,59,59]t_str = ""for i in range(len(time)): if i<len(time)-1: t_str += str(time[i])+":" else: t_str += str(time[i])print(t_str)程序输出结果是23:59:59
- ( )不是有效的推理。 A: 前提:("x)(~P(x)ÞQ(x)), ("x)~Q(x)结论:P(a) B: 前提:("x)(P(x)ÞQ) 结论:("x)P(x)ÞQ C: 前提:("x)(P(x)∨Q(x)), ("x)(Q(x)Þ~R(x)) 结论:($x)(R(x)ÞP(x)) D: 前提:("x)(P(x)Þ(Q(x)∧R(x))), ($x)(P(x)∧S(x))结论:("x)(R(x)∧S(x)) E: 前提:("x)($y)P(x, y)结论:("x)($y)($z)(P(x, y)∧P(y, z)) F: 前提:("x)P(x)∨("x)Q(x)结论:("x)(P(x)∨Q(x)) G: 前提:("x)(G(x)ÞH(x)),~($x)(F(x)∧H(x))结论:($x)F(x)Þ($x)G(x) H: 前提:("x)(H(x)ÞM(x))结论:("x)("y)(H(y)∧N(x, y)) Þ ($y)(M(y)∧N(a, y) )
- 程序执行时输入12和34,结果如下所示,那么print()函数正确的调用形式是( )请输入x:12请输入y:34x= 12 y= 34 A: print("x=",x ; "y=",y) B: print("x=",x,"y=",y) C: print(x,y) D: print(x=,x,y=,y)
- datetime.datetime.now()格式化成(strftime)"2018-11-1020:09:52"的字符串是?() A: "%Y-%m-%d%H:%M:%s" B: "%Y-%m-%d%H:%M:%S" C: "%Y-%M-%d%H:%m:%S" D: "%Y-%m-%D%H:%M:%S"