Unnamed: 0 int64 0 48.6k | userId int64 2 2.38k | name stringclasses 71
values | questionId int64 28 29k | question stringclasses 98
values | exceptedAnswer stringclasses 133
values | attemptId int64 85 185k | state stringclasses 3
values | studentAnswer stringlengths 1 3.39k | testOutcome stringlengths 477 12.6k | attemptstepid int64 238 770k | status int64 1 4 | R_errorcount int64 0 8 | R_traceback stringlengths 8 1.3k | R_errortype stringclasses 14
values | C_errormessage stringlengths 8 927 | C_errortype stringclasses 5
values | all_errortype stringclasses 18
values | all_errortype2 stringclasses 19
values | error_category stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
43,664 | 1,993 | 变量和赋值 3.5 | 3,018 | 按要求写出代码。
* 要求:
* 用户会输入两个数值,依次是猫的数量num_cats,一个是狗的数量num_dogs。
* 打印猫和狗总共的数量,并创建一个新的空行。
例1:
输入:1 2
输出:3
解释:1 + 2 = 3
例2:
输入:20 20
输出:40
解释:20 + 20 = 40
| total_animals = 0
num_cats = int(input())
num_dogs = int(input())
total_animals = num_cats + num_dogs
print(total_animals) | 167,183 | todo | num_cats=input()
num_dogs=input()
print(num_cats+num_dogs,/n) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:126:" File "__tester__.python3", line 3
print(num_cats+num_dogs,/n)
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresul... | 699,282 | 2 | 0 | No error | No error | File "__tester__.python3", line 3
print(num_cats+num_dogs,/n)
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
29,629 | 257 | 输入和输出 1.13 | 2,931 | 按要求写出代码。
* 要求:
* 把用户输入的值打印出来。
* 最后有一个空行。
例1:
输入:3
输出:3
例2:
输入:hi
输出:hi
| result = input()
print(result) | 94,635 | todo | print(',/n') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2263";s:10:"questionid";s:4:"2931";s:8:"testtype";s:1:"0";s:8... | 624,192 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
20,891 | 771 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 58,766 | todo | num = input()
print(num," 岁")
print(" ") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2273";s:10:"questionid";s:4:"2933";s:8:"testtype";s:1:"0";s:8... | 257,359 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
44,013 | 2,044 | Lab2.1 | 346 | 定义一个叫做smallest_among_three的函数,输入三个参数,打印最小的参数。
| x = int(input())
y = int(input())
z = int(input())
def smallest_among_three(x, y, z):
if (x < y):
if (x < z):
return x
else:
return z
else:
if (y < z):
return y
else:
return z
print(smallest_among_three(x, y, z)) | 168,939 | todo | x = int(input())
y = int(input())
z = int(input())
def smallest_among_three(x, y, z):
if (x<y)and(x<z):
print(x)
elif(y<z)and(y<x):
print(y)
elif(z<x)and(z<y):
print(z)
print(smallest_among_three(x, y, z)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:3;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:0;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"395";s:10:"questionid";s:3:"346";s:8:"testtype";s:1:"0";s:8:"... | 706,475 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
7,976 | 296 | 列表3.1 | 472 | 请编写一个函数get_max(),传入一个列表参数my_list,其中的值都是格式为string的正整数,返回该列表里的最大数。
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果。
| temp_list = input().split(',')
# 请不要更改此行以上的代码
def get_max(my_list):
num_max = 0
for i in my_list:
num_max = max(int(i), num_max)
return num_max
# 请不要更改此行以下的代码
print(get_max(temp_list)) | 16,458 | complete | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def get_max(x):
max = int(temp_list[0])
for i in range(1,len(temp_list)):
temp = int(temp_list[i])
if(temp > max):
max = temp
return max
# 请不要更改此行以下的代码
print(get_max(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:4;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"492";s:10:"questionid";s:3:"472";s:8:"testtype";s:1:"0";s:8:"... | 84,774 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
5,295 | 93 | 定义变量 | 325 | 定义一个叫做 num_students 的变量,并将它的值设置为100. | num_students = 100
print(num_students) | 8,946 | complete | # 在这里补全代码
num_students=100
print(num_students) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"369";s:10:"questionid";s:3:"325";s:8:"testtype";s:1:"0";s:8:"... | 51,652 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
6,396 | 244 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 12,276 | todo | age = 10
print("my age is " + age) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"377";s:10:"questionid";s:3:"339";s:8:"testtype";s:1:"0";s:8:"... | 67,392 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 3, in <module>
print("my age is " + age)
TypeError: can only concatenate str (not "int") to str
" | TypeError | No error | No error | TypeError | TypeError | error |
40,867 | 1,302 | 递归LAB1 | 611 | 编写一个函数fib_3(num),返回以下数列的第num项(从0开始)。
1, 1, 1, 3, 5, 9, 17, 31 ......
其中每项等于前三项的和, 第num项应是 第num-1, num - 2, num -3项的和。
| input_int = int(input())
# 请不要更改此行以上的代码
def fib_3(num):
if num == 0:
return 1
elif num == 1:
return 1
elif num == 2:
return 1
else:
return fib_3(num - 2) + fib_3(num - 1) + fib_3(num - 3)
# 请不要更改此行以下的代码
print(fib_3(input_int)) | 158,235 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def fib_3(num):
if num ==0: # 在这里补充代码:
return 1 # 在这里补充代码
elif: num ==1 # 在这里补充代码:
return 2# 在这里补充代码
elif: num==2 # 在这里补充代码:
# 在这里补充代码
return 1
else:
return fib_3((num-3)+(num-2)+(num-1))# 在这里补充代码
# 请不要更改此行以下的代码
print(f... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:117:" File "__tester__.python3", line 7
elif: num ==1 # 在这里补充代码:
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:6;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcec... | 662,954 | 2 | 0 | No error | No error | File "__tester__.python3", line 7
elif: num ==1 # 在这里补充代码:
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
25,845 | 771 | 列表3.3 | 476 | 请编写一个函数palindrome(),传入一个列表参数my_list,其中的值都是长度为1的string,返回一个boolean,判断在去掉最后一位和第一位后,该列表是否是回文。
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果(可以更改原列表的内容)。
| temp_list = input().split(',')
# 请不要更改此行以上的代码
def palindrome(my_list):
my_list.pop()
my_list.remove(my_list[0])
return my_list == my_list[::-1]
# 请不要更改此行以下的代码
print(palindrome(temp_list)) | 70,961 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
def palindrome(my_list):
for i in range(0,len(my_list)):
if(my_list[i]==my_list[len(my_list)-i]):
return Ture
else:
return False
# 请不要更改此行以下的代码
print(palindrome(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"514";s:10:"questionid";s:3:"476";s:8:"testtype";s:1:"0";s:8:"... | 555,491 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 13, in <module>
print(palindrome(temp_list))
File "__tester__.python3", line 6, in palindrome
if(my_list[i]==my_list[len(my_list)-i]):
IndexError: list index out of range
" | IndexError | No error | No error | IndexError | IndexError | error |
45,497 | 2,129 | 范围 3.9 | 3,293 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int,存入time。
* 如果time大于8且小于22,打印'醒着';
* 否则,打印'睡觉了'。
例1:
输入:8
输出:睡觉了
解释:8=8,8不符合大于8小于22的条件,所以打印'睡觉了'。
例2:
输入:12
输出:醒着
解释:12符合大于8小于22的条件,所以打印'醒着'。
| time = int(input())
if 8 < time < 22:
print('醒着')
else:
print('睡觉了') | 175,085 | complete | time = int(input())
if (8<time<22):
print("醒着")
else:
print("睡觉了") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2380";s:10:"questionid";s:4:"3293";s:8:"testtype";s:1:"0";s:8... | 728,758 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
45,465 | 2,129 | 输入和输出 1.8 | 3,474 | 按要求写出代码。
* 要求:
* 把用户输入的两个值转换成整数型,并分别存储。
* 打印这两个输入值的和。
例1:
输入:3 4
输出:7
解释:3 + 4 = 7
例2:
输入:9 10
输出:19
解释:9 + 10 = 19
| num1 = int(input())
num2 = int(input())
print (num1 + num2) | 174,995 | todo | a=int(input("输入数字:"))
b=int(input("输入数字:"))
print(a+b) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2410";s:10:"questionid";s:4:"3474";s:8:"testtype";s:1:"0";s:8... | 728,468 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
48,531 | 2,380 | 循环3.3 | 395 | 请逐位打印一个字符串。
如:
输入:CircleCat
输出
C
i
r
c
l
e
c
a
t
| param = input()
for i in param:
print(i) | 184,801 | complete | param = input()
for i in param:
print(i)
# 在此处补全答案 | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:4;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"447";s:10:"questionid";s:3:"395";s:8:"testtype";s:1:"0";s:8:"... | 767,673 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
37,749 | 932 | 判断1 | 366 | 补全代码,定义一个函数get_discount(),如果用户的身高小于140(不含),返回票价0,否则返回票价100。
| param = int(input())
def get_discount(height):
if (height < 140):
return 0
else:
return 100
print(get_discount(param)) | 148,049 | todo | param = int(input())
# 在此处补全代码
def get_discount(param):
if param <140:
retrun 0
else:
return 100
print(get_discount(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:91:" File "__tester__.python3", line 6
retrun 0
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:... | 615,848 | 2 | 0 | No error | No error | File "__tester__.python3", line 6
retrun 0
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
4,681 | 27 | 递归2.2 | 286 | 用递归编写一个函数power_of_two(num)计算2的num次方。
如power_of_two(0) 应返回2的0次方,即1;
power_of_two(1) 应返回2的1次方,即2;
power_of_two(3) 应返回2的3次方,即8。
| input_int = int(input())
# 请不要更改此行以上的代码
def power_of_two(num):
if num == 0:
return 1
else:
return 2 * power_of_two(num - 1)
# 请不要更改此行以下的代码
print(power_of_two(input_int)) | 7,403 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def power_of_two(num):
if num == 0:
print '1'
else:
print 2**num
# 请不要更改此行以下的代码
print(power_of_two(input_int)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:141:" File "__tester__.python3", line 6
print '1'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('1')?
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;... | 38,536 | 2 | 0 | No error | No error | File "__tester__.python3", line 6
print '1'
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('1')?
| SyntaxError | SyntaxError | SyntaxError | error |
17,333 | 659 | 输入和输出 1.11 | 2,928 | 按要求写出代码。
* 要求:
* 打印:
你好
我在吃饭
(注意最后有一个空行)
| print("你好")
print("我在吃饭") | 46,933 | complete | print('你好')
print('我在吃饭')
print() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2256";s:10:"questionid";s:4:"2928";s:8:"testtype";s:1:"0";s:8... | 208,930 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
10,125 | 348 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 24,027 | complete | param = int(input())
def print_num(param):
if param==10:
return(param)
else:
return('')
print(print_num(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"423";s:10:"questionid";s:3:"369";s:8:"testtype";s:1:"0";s:8:"... | 112,629 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
42,476 | 1,362 | 列表LAB0.2 | 548 | 请写一个函数multiply_lists(),传入一个列表参数my_list, 和一个int参数factor。
将my_list扩张到factor倍,并返回。
例如:
my_list = [1, 2]
factor = 3
返回 [1, 2, 1, 2, 1, 2]
请不要使用任何列表自带函数。
| import ast
input_list = ast.literal_eval(input())
input_int = int(input())
# 请不要更改此行以上的代码
def multiply_lists(my_list, factor):
return my_list * factor
# 请不要更改此行以下的代码
print(multiply_lists(input_list, input_int)) | 162,782 | todo | import ast
input_list = ast.literal_eval(input())
input_int = int(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def multiply_lists(my_list, factor):
while factor > 1:
mutiply_list = my_list.extend(my_list)
n = int(len(my_list))
m = factor
q = len(mutiply_list)
if q == n * m:... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"594";s:10:"questionid";s:3:"548";s:8:"testtype";s:1:"0";s:8:"... | 681,544 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 18, in <module>
print(multiply_lists(input_list, input_int))
File "__tester__.python3", line 12, in multiply_lists
q = len(mutiply_list)
TypeError: object of type 'NoneType' has no len()
" | TypeError | No error | No error | TypeError | TypeError | error |
25,632 | 791 | 循环LAB3 | 399 | 编写一个函数count_spaces_and_commas,打印出有几个空格和逗号。
例如:
输入: 你好,我的名字叫 逗猫师。
打印: 有1个逗号和1个空格
输入:我 你 她
打印:有0个逗号和2个空格
输入:,,,
打印:有3个逗号和0个空格
| param = input()
def count_spaces_and_commas(s):
num_spaces = 0
num_commas = 0
for i in s:
if i == " ":
num_spaces += 1
if i == ",":
num_commas += 1
print("有"+ str(num_commas) +"个逗号和" + str(num_spaces) + "个空格")
count_spaces_and_commas(param) | 70,488 | todo | a = str(input())
x=0
y=0
for i in a:
if(i==","):
x=x+1
if(i==" "):
y=y+1
else:
x=x
y=y
continue
print("有"+x"个逗号"+"有"+y+"个空格")
| O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:133:" File "__tester__.python3", line 13
print("有"+x"个逗号"+"有"+y+"个空格")
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"testresults";a:0:{... | 313,820 | 2 | 0 | No error | No error | File "__tester__.python3", line 13
print("有"+x"个逗号"+"有"+y+"个空格")
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
8,488 | 226 | 分支 1.5 | 3,123 | 按要求写出代码。
* 要求:
* 把用户的输入转换成int存入变量user_age。 * 如果user_age == 18,给num_candles赋值为18。
* 否则,给num_candles赋值为3。
* 打印num_candle。
| user_age = int(input())
if user_age == 18:
num_candles = 18
else:
num_candles = 3
print(num_candles) | 18,856 | todo | user_age = int(input())
num_candles = 0
if user_age == 18:
num_candles = 18
else:
num_candles = 3
print(num_candle) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2300";s:10:"questionid";s:4:"3123";s:8:"testtype";s:1:"0";s:8... | 93,862 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 7, in <module>
print(num_candle)
NameError: name 'num_candle' is not defined
" | NameError | No error | No error | NameError | NameError | error |
21,727 | 590 | 判断1 | 366 | 补全代码,定义一个函数get_discount(),如果用户的身高小于140(不含),返回票价0,否则返回票价100。
| param = int(input())
def get_discount(height):
if (height < 140):
return 0
else:
return 100
print(get_discount(param)) | 60,681 | todo | param = int(input())
if param<140:
get_discount()=0
else:
get_discount()=100
print(get_discount(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:108:" File "__tester__.python3", line 4
get_discount()=0
^
SyntaxError: cannot assign to function call
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"so... | 264,323 | 2 | 0 | No error | No error | File "__tester__.python3", line 4
get_discount()=0
^
SyntaxError: cannot assign to function call
| SyntaxError | SyntaxError | SyntaxError | error |
36,947 | 72 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 146,106 | todo | print("00000")
print("0""""0""""0")
print("00000") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2226";s:10:"questionid";s:4:"2862";s:8:"testtype";s:1:"0";s:8... | 608,126 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
33,805 | 1,119 | 列表LAB0.2 | 548 | 请写一个函数multiply_lists(),传入一个列表参数my_list, 和一个int参数factor。
将my_list扩张到factor倍,并返回。
例如:
my_list = [1, 2]
factor = 3
返回 [1, 2, 1, 2, 1, 2]
请不要使用任何列表自带函数。
| import ast
input_list = ast.literal_eval(input())
input_int = int(input())
# 请不要更改此行以上的代码
def multiply_lists(my_list, factor):
return my_list * factor
# 请不要更改此行以下的代码
print(multiply_lists(input_list, input_int)) | 126,216 | todo | import ast
input_list = ast.literal_eval(input())
input_int = int(input())
# 请不要更改此行以上的代码
def multiply_lists(my_list,factor):
my_list=3*factor
return(my_list)
# 请不要更改此行以下的代码
print(multiply_lists(input_list, input_int)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"594";s:10:"questionid";s:3:"548";s:8:"testtype";s:1:"0";s:8:"... | 536,292 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
6,965 | 226 | 函数1.0 | 402 | 定义一个叫做 WELCOME_TO_CIRLCLE_CAT() 的函数,它的内容是打印以下这句话
"Welcome to circle cat!"
并使用这个函数2次(不包含题目内的一次)。
| def welcome_to_cirlcle_cat():
print("Welcome to circle cat!")
welcome_to_cirlcle_cat()
welcome_to_cirlcle_cat()
# 请不要更改此行以下的代码
welcome_to_cirlcle_cat() | 13,180 | complete | # 在这里编写代码
def welcome_to_cirlcle_cat():
print("Welcome to circle cat!")
print("Welcome to circle cat!")
print("Welcome to circle cat!")
# 请不要更改此行以下的代码
welcome_to_cirlcle_cat() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"476";s:10:"questionid";s:3:"402";s:8:"testtype";s:1:"0";s:8:"... | 67,263 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
43,129 | 1,394 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 165,022 | complete | param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
else:
return
print_num(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"423";s:10:"questionid";s:3:"369";s:8:"testtype";s:1:"0";s:8:"... | 692,320 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
31,503 | 301 | 判断2 | 367 | 定义一个函数get_age_status,
输入年龄,如果在0至18(不含),打印“未成年人”;
如果在18-65(不含),打印“工作中”;
如果在65以上,打印“退休了”。
| param = int(input())
def get_age_status(age):
if age < 18:
return "未成年人"
elif age < 65:
return "工作中"
else:
return "退休了"
print(get_age_status(param)) | 114,828 | complete | param = int(input())
# 在此补全代码
def get_age_status(param):
if (0 < param < 18):
return"未成年人"
elif (18 <= param < 65):
return"工作中"
else:
return"退休了"
print(get_age_status(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"413";s:10:"questionid";s:3:"367";s:8:"testtype";s:1:"0";s:8:"... | 482,284 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
14,523 | 341 | 字典LAB2 | 555 | 【考勤计数器】
编写一个程序来记录考勤,包含一个函数:
log_user(user_name) 不返回任何信息,记录user_name的一次到课
print_user_log(user_name) 不返回任何信息,打印user_name到课几次
如:
log_user("Circle")
log_user("Circle")
log_user("Cat")
log_user("Circle")
print_user_log("Circle")
print_user_log("Cat")
print_user_log("Flirter")
结果为:
3
1
0
如果没有思路请看下面提示
第̶一̶步̶:̶定̶义... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def log_user(user_name):
if user_name in user_info:
user_info[user_name] += 1
else:
user_info[user_name] = 1
def print_user_log(user_name):
if user_name in user_info:
print(user_info[user_name]... | 37,827 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
user_info={}
def log_user(user_name):
if(user_name not in user_info):
user_info[user_name]=0
user_info[user_name]+=1
def print_user_log(user_name):
if (user_name in user_info):
print(user_info[... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"624";s:10:"questionid";s:3:"555";s:8:"testtype";s:1:"0";s:8:"... | 173,932 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 22, in <module>
print_user_log(i)
File "__tester__.python3", line 16, in print_user_log
print(print_user_log[user_name])
TypeError: 'function' object is not subscriptable
" | TypeError | No error | No error | TypeError | TypeError | error |
14,439 | 470 | 变量和赋值 3.5 | 3,018 | 按要求写出代码。
* 要求:
* 用户会输入两个数值,依次是猫的数量num_cats,一个是狗的数量num_dogs。
* 打印猫和狗总共的数量,并创建一个新的空行。
例1:
输入:1 2
输出:3
解释:1 + 2 = 3
例2:
输入:20 20
输出:40
解释:20 + 20 = 40
| total_animals = 0
num_cats = int(input())
num_dogs = int(input())
total_animals = num_cats + num_dogs
print(total_animals) | 37,668 | complete | num_cats=int(input())
num_dogs=int(input())
a=num_cats+num_dogs
print(a)
print() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2285";s:10:"questionid";s:4:"3018";s:8:"testtype";s:1:"0";s:8... | 171,090 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
12,609 | 412 | 循环LAB3 | 399 | 编写一个函数count_spaces_and_commas,打印出有几个空格和逗号。
例如:
输入: 你好,我的名字叫 逗猫师。
打印: 有1个逗号和1个空格
输入:我 你 她
打印:有0个逗号和2个空格
输入:,,,
打印:有3个逗号和0个空格
| param = input()
def count_spaces_and_commas(s):
num_spaces = 0
num_commas = 0
for i in s:
if i == " ":
num_spaces += 1
if i == ",":
num_commas += 1
print("有"+ str(num_commas) +"个逗号和" + str(num_spaces) + "个空格")
count_spaces_and_commas(param) | 32,796 | complete | param = input()
# 在此处编写代码
def count_spaces_and_commas(x):
a = x.count(",")
b = x.count(" ")
print ("有"+str(a)+"个逗号和"+str(b)+"个空格")
count_spaces_and_commas(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:4;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"464";s:10:"questionid";s:3:"399";s:8:"testtype";s:1:"0";s:8:"... | 148,889 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
24,762 | 829 | 变量和赋值 3.5 | 3,018 | 按要求写出代码。
* 要求:
* 用户会输入两个数值,依次是猫的数量num_cats,一个是狗的数量num_dogs。
* 打印猫和狗总共的数量,并创建一个新的空行。
例1:
输入:1 2
输出:3
解释:1 + 2 = 3
例2:
输入:20 20
输出:40
解释:20 + 20 = 40
| total_animals = 0
num_cats = int(input())
num_dogs = int(input())
total_animals = num_cats + num_dogs
print(total_animals) | 67,944 | complete | num_cats=int(input())
num_dogs=int(input())
print(num_cats+num_dogs) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2285";s:10:"questionid";s:4:"3018";s:8:"testtype";s:1:"0";s:8... | 300,807 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
15,557 | 410 | 成员&标识 | 3,418 | 按要求写出代码。
* 要求:
* 已经给出列表my_list。
* 把用户输入的值转换成int存入变量my_guess。
* 如果my_guess在my-list里,打印'猜对了';
* 否则,打印'猜错了'。
例1:
输入:75
输出:猜对了
解释:75在列表中。
例2:
输入:19
输出:猜错了
解释:19不在列表中。
| my_list = [10, 75, 94]
my_guess = int(input())
if my_guess in my_list:
print('猜对了')
else:
print('猜错了') | 41,714 | complete | my_list = [10, 75, 94]
my_guess=int(input())
if my_guess in my_list:
print("猜对了")
else: print("猜错了") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2395";s:10:"questionid";s:4:"3418";s:8:"testtype";s:1:"0";s:8... | 189,250 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
29,445 | 878 | 递归2.2 | 592 | 用递归编写一个函数power_of_two(num)计算2的num次方。
如power_of_two(0) 应返回2的0次方,即1;
power_of_two(1) 应返回2的1次方,即2;
power_of_two(3) 应返回2的3次方,即8。
| input_int = int(input())
# 请不要更改此行以上的代码
def power_of_two(num):
if num == 0:
return 1
else:
return 2 * power_of_two(num - 1)
# 请不要更改此行以下的代码
print(power_of_two(input_int)) | 93,261 | complete | input_int = int(input())
# 请不要更改此行以上的代码
def power_of_two(num):
if num == 0:
return 1
else:
return power_of_two(num-1)*2
# 请不要更改此行以下的代码
print(power_of_two(input_int)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"671";s:10:"questionid";s:3:"592";s:8:"testtype";s:1:"0";s:8:"... | 404,841 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
39,524 | 1,153 | 循环LAB1 | 397 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 153,768 | complete | param = input()
def reverse_string(param):
for i in range(len(param)-1, -1,-1):
print(param[i],end="")
# 在此处编写代码
reverse_string(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:4;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"456";s:10:"questionid";s:3:"397";s:8:"testtype";s:1:"0";s:8:"... | 642,537 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
48,229 | 2,340 | 判断1 | 366 | 补全代码,定义一个函数get_discount(),如果用户的身高小于140(不含),返回票价0,否则返回票价100。
| param = int(input())
def get_discount(height):
if (height < 140):
return 0
else:
return 100
print(get_discount(param)) | 184,153 | todo | def get_discount(height):
if height >= 140:
return 100
else:
return 0 | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"408";s:10:"questionid";s:3:"366";s:8:"testtype";s:1:"0";s:8:"... | 764,713 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
18,365 | 28 | 字典LAB1 | 553 | 【用户名密码验证】
编写一个程序做到添加/验证用户名密码,包含两个函数:
add_user(user_name, pass_word) 不返回任何信息,用于添加一个用户,用户名是user_name,密码是pass_word
verify_user(user_name, pass_word)返回Boolean值(代表用户名密码是否正确),如果存在用户名为user_name,密码为pass_word的用户,则返回True,密码错误或者用户不存在则返回False
如:
add_user("circle", "cat")
print(verify_user("circle","cat"))
print(verify_user("... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
return False
# 请不要... | 51,446 | complete | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
else:
... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"616";s:10:"questionid";s:3:"553";s:8:"testtype";s:1:"0";s:8:"... | 262,351 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,557 | 10 | LAB1.0 | 342 | 补全以下代码,使其打印x被y除三次,并打印每次的结果。
如:
x = 8
y = 2
则输出:
4.0
2.0
1.0
| x = int(input())
y = int(input())
x /= y
print(x)
x /= y
print(x)
x /= y
print(x) | 35,141 | complete | x = int(input())
y = int(input())
x = x / y
print(x)
x = x / y
print(x)
x = x / y
print(x)
| O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"385";s:10:"questionid";s:3:"342";s:8:"testtype";s:1:"0";s:8:"... | 159,563 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
35,868 | 1,181 | 范围 3.6 | 3,279 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int,存入film_rate。
* 如果film_rate大于7,打印'好看';
* 否则,打印'不好看'。
例1:
输入:8
输出:好看
解释:8 > 7,所以打印'好看'。
例2:
输入:7
输出:不好看
解释:7 = 7,不符合大于7的条件。所以打印'不好看'。
| film_rate = int(input())
if film_rate > 7:
print('好看')
else:
print('不好看')
| 140,589 | todo | film_rate = int(input())
if film_rate > 7:
print("好看")
else:
print("不好看") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:81:"Sorry: IndentationError: expected an indented block (__tester__.python3, line 3)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandbo... | 592,873 | 2 | 0 | No error | No error | Sorry: IndentationError: expected an indented block (__tester__.python3, line 3)
| IndentationError | IndentationError | IndentationError | error |
46,241 | 1,057 | LAB2.2 | 348 | 补全以下代码,判断该年份是否是闰年。
如果是闰年,则打印“是闰年”;
否则,打印“不是闰年”。
| i = int(input())
def is_leap_year(year):
if ((year % 4 == 0 and year % 100 != 0) or year % 400 == 0):
return "是闰年"
else:
return "不是闰年"
print(is_leap_year(i)) | 178,599 | todo | i = int(input())
def is_leap_year(year):
if year%4 == 0:
return ('是闰年')
else:
return ('不是闰年')
print(is_leap_year(i)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:124:" File "__tester__.python3", line 5
return ('是闰年')
^
SyntaxError: invalid character '(' (U+FF08)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14... | 742,599 | 2 | 0 | No error | No error | File "__tester__.python3", line 5
return ('是闰年')
^
SyntaxError: invalid character '(' (U+FF08)
| SyntaxError | SyntaxError | SyntaxError | error |
37,820 | 72 | LAB2.2 | 348 | 补全以下代码,判断该年份是否是闰年。
如果是闰年,则打印“是闰年”;
否则,打印“不是闰年”。
| i = int(input())
def is_leap_year(year):
if ((year % 4 == 0 and year % 100 != 0) or year % 400 == 0):
return "是闰年"
else:
return "不是闰年"
print(is_leap_year(i)) | 148,246 | complete | i = int(input())
def is_leap_year(i):
if((i%4==0)and(i%100!=0)or(i%400==0)):
return("是闰年")
else:
return("不是闰年")
# 在这里补全代码
print(is_leap_year(i)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"403";s:10:"questionid";s:3:"348";s:8:"testtype";s:1:"0";s:8:"... | 617,155 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
37,193 | 932 | 2.5 | 2,974 | 把下面代码中的语法错误改好,重新写出来。
print('I can")
print(swim.)
my_age = 10
print('my age:' my_age)
| print('I can')
print('swim.')
my_age = 10
print('my age:', my_age) | 146,742 | todo | print('I can')
print('swim.')
my_age = 10
print('my age: ')
print(my_age) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2279";s:10:"questionid";s:4:"2974";s:8:"testtype";s:1:"0";s:8... | 611,040 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
28,079 | 818 | 分支 1.6 | 3,126 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int并存入变量num_spiders。
* 给变量web_size的初始值赋值为1。
* 如果num_spiders等于10,web_size变成原来的两倍;
* 否则,web_size变成原来的三倍,并且num_spiders加5。
* 最后,把num_spiders和web_size按顺序打印在同一行,用一个空格分开。
例1:
输入:10
输出:10 2
解释:num_spiders等于10,所以web_size变为原来的两倍。
例2:
输入:15
输出:20 3
解释:num_spiders等于15,不符合等于10的条件,所以web_siz... | num_spiders = int(input())
web_size = 1
if num_spiders == 10:
web_size = 2 * web_size
else:
web_size = 3 * web_size
num_spiders = num_spiders + 5
print(num_spiders,web_size) | 82,585 | complete | num_spiders=int(input())
web_size=1
if num_spiders==10:
web_size=web_size*2
else:
web_size=web_size*3
num_spiders=num_spiders+5
print(num_spiders,web_size) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2315";s:10:"questionid";s:4:"3126";s:8:"testtype";s:1:"0";s:8... | 371,626 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
249 | 51 | 定义变量 | 28 | 定义一个叫做 num_students 的变量,并将它的值设置为100. | num_students = 100
print(num_students) | 373 | todo | # num_student = input("请输入")
num_student = 100
if num_student < 100:
print(false)
elif num_srudent > 100:
print(false)
print(num_students) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:2:"12";s:10:"questionid";s:2:"28";s:8:"testtype";s:1:"0";s:8:"te... | 11,708 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 5, in <module>
elif num_srudent > 100:
NameError: name 'num_srudent' is not defined
" | NameError | No error | No error | NameError | NameError | error |
46,883 | 2,257 | 分支 1.5 | 3,477 | 按要求写出代码。
* 要求:
* 把用户的输入转换成int存入变量user_age。
* 如果user_age == 18,给num_candles赋值为18。
* 否则,给num_candles赋值为3。
* 打印num_candles。
| user_age = int(input())
if user_age == 18:
num_candles = 18
else:
num_candles = 3
print(num_candles) | 180,596 | todo | user_age=input(int())
if(user_age==18):
num_candles=18
else:
num_candles=3
print(num_candles) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:4;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2425";s:10:"questionid";s:4:"3477";s:8:"testtype";s:1:"0";s:8... | 749,590 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
37,879 | 932 | 循环LAB3 | 399 | 编写一个函数count_spaces_and_commas,打印出有几个空格和逗号。
例如:
输入: 你好,我的名字叫 逗猫师。
打印: 有1个逗号和1个空格
输入:我 你 她
打印:有0个逗号和2个空格
输入:,,,
打印:有3个逗号和0个空格
| param = input()
def count_spaces_and_commas(s):
num_spaces = 0
num_commas = 0
for i in s:
if i == " ":
num_spaces += 1
if i == ",":
num_commas += 1
print("有"+ str(num_commas) +"个逗号和" + str(num_spaces) + "个空格")
count_spaces_and_commas(param) | 148,311 | todo | param = input()
# 在此处编写代码
def count_spaces_and_commas(param):
for i in param:
count = 0
comma = 0
if i ==",":
count = count +1
elif i == " ":
comma = comma +1
print ("有"+str(count)+"个逗号"+"和"+str(comma)+"个空格")
| O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"464";s:10:"questionid";s:3:"399";s:8:"testtype";s:1:"0";s:8:"... | 618,185 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 14, in <module>
print ("有"+str(count)+"个逗号"+"和"+str(comma)+"个空格")
NameError: name 'count' is not defined
" | NameError | No error | No error | NameError | NameError | error |
12,961 | 271 | 字典LAB0.2 | 551 | 提供一个int字典my_dict,若其中含有key为1,3,5,7的项,则将这些项删除。
如:
my_dict = {1:0, 3:1, 5:9, 7:16}
执行完毕后应为:
my_dict = {}
如:
my_dict = {1:7, 5:9, 0:20}
执行完毕后应为:
my_dict = {0:20}
如:
my_dict = {0:20, 2:40, 4:60}
执行完毕后应为:
my_dict = {0:20, 2:40, 4:60}
| input_dict = input()
my_dict = eval(input_dict)
# 请不要更改此行以上的代码
to_delete = [1,3,5,7]
for i in to_delete:
if i in my_dict:
del my_dict[i]
# 请不要更改此行以下的代码
print(my_dict) | 33,484 | todo | input_dict = input()
my_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
for {key:value} in my_dict{}:
if key in [1,3,5,7]:
del my_dict[key]
# 请不要更改此行以下的代码
print(my_dict)
| O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:131:" File "__tester__.python3", line 6
for {key:value} in my_dict{}:
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"test... | 152,022 | 2 | 0 | No error | No error | File "__tester__.python3", line 6
for {key:value} in my_dict{}:
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
32,470 | 1,069 | 判断2 | 367 | 定义一个函数get_age_status,
输入年龄,如果在0至18(不含),打印“未成年人”;
如果在18-65(不含),打印“工作中”;
如果在65以上,打印“退休了”。
| param = int(input())
def get_age_status(age):
if age < 18:
return "未成年人"
elif age < 65:
return "工作中"
else:
return "退休了"
print(get_age_status(param)) | 120,651 | todo | param = int(input())
def (get_age_status(param)):
if (0<param<18):
print("未成年人")
elif (18<param<65):
print("工作中")
elif (param>65):
print("退休了")
print(get_age_status(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:108:" File "__tester__.python3", line 3
def (get_age_status(param)):
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"so... | 512,143 | 2 | 0 | No error | No error | File "__tester__.python3", line 3
def (get_age_status(param)):
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
43,249 | 1,425 | 判断2 | 367 | 定义一个函数get_age_status,
输入年龄,如果在0至18(不含),打印“未成年人”;
如果在18-65(不含),打印“工作中”;
如果在65以上,打印“退休了”。
| param = int(input())
def get_age_status(age):
if age < 18:
return "未成年人"
elif age < 65:
return "工作中"
else:
return "退休了"
print(get_age_status(param)) | 165,439 | complete | param = int(input())
# 在此补全代码
def get_age_status(i):
if 0<i<18:
return ("未成年人")
elif i<65:
return ("工作中")
else:
return("退休了")
print(get_age_status(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"413";s:10:"questionid";s:3:"367";s:8:"testtype";s:1:"0";s:8:"... | 691,693 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
25,615 | 791 | 循环1.7 | 2,432 | 编写一个函数double_until_one_thousand, 将其打印出来后,乘二,再打印,直至其大于1000。
| param = int(input())
def double_until_one_thousand(num):
while(num <= 1000):
print(num)
num *= 2
double_until_one_thousand(param) | 70,477 | todo | param=int(input())
def double_until_one_thousand(param):
print(param)
while param<=1000:
param=param*2
print(param)
double_until_one_thousand(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2074";s:10:"questionid";s:4:"2432";s:8:"testtype";s:1:"0";s:8... | 313,113 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
8,565 | 263 | 列表LAB0.1 | 546 | 请写一个函数get_min_plus_max(),传入一个列表参数my_list; 其中都是int。
返回列表中的最大值 + 最小值。
例1:
my_list = [-5, 1, 0]
最小值-5,最大值1, 返回 -4
例2:
my_list = [4, 2, 2, -7, 4, -5, 7, 2, -3, -6]
最小值-7,最大值7, 返回 0
请不要使用任何列表自带函数,也不要创建一个新的列表.
| import ast
input_list = ast.literal_eval(input())
# 请不要更改此行以上的代码
def get_min_plus_max(my_list):
min_num = my_list[0]
max_num = my_list[0]
for i in my_list:
min_num = min(i, min_num)
max_num = max(i, max_num)
return min_num + max_num
# 请不要更改此行以下的代码
print(get_min_plus_max(input_list)) | 19,033 | complete | import ast
input_list = ast.literal_eval(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def get_min_plus_max(my_list):
max_num=my_list[0]
min_num=my_list[0]
for i in my_list:
if i>=max_num:
max_num=i
if i<=min_num:
min_num=i
return max_num+min_num
... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:8;s:11:"testresults";a:8:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"581";s:10:"questionid";s:3:"546";s:8:"testtype";s:1:"0";s:8:"... | 94,180 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,686 | 178 | LAB2.2 | 348 | 补全以下代码,判断该年份是否是闰年。
如果是闰年,则打印“是闰年”;
否则,打印“不是闰年”。
| i = int(input())
def is_leap_year(year):
if ((year % 4 == 0 and year % 100 != 0) or year % 400 == 0):
return "是闰年"
else:
return "不是闰年"
print(is_leap_year(i)) | 35,563 | complete | i = int(input())
def is_leap_year(year):
# 在这里补全代码
if (i % 400==0):
return'是闰年'
elif (i % 400!=0):
if ((i % 4==0)and(i % 100 !=0)):
return'是闰年'
else:
return'不是闰年'
print(is_leap_year(i)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:126:" File "__tester__.python3", line 5
if (i % 400==0):
^
SyntaxError: invalid character in identifier
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults... | 161,159 | 2 | 0 | No error | No error | File "__tester__.python3", line 5
if (i % 400==0):
^
SyntaxError: invalid character in identifier
| SyntaxError | SyntaxError | SyntaxError | error |
43,183 | 555 | 列表3.1 | 472 | 请编写一个函数get_max(),传入一个列表参数my_list,其中的值都是格式为string的正整数,返回该列表里的最大数。
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果。
| temp_list = input().split(',')
# 请不要更改此行以上的代码
def get_max(my_list):
num_max = 0
for i in my_list:
num_max = max(int(i), num_max)
return num_max
# 请不要更改此行以下的代码
print(get_max(temp_list)) | 165,196 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
max_number = int(temp_list[0])
index = 1
# 在这里编写代码
while index < len(temp_list):
num = int(temp_list[index])
if num > max_number:
max_number = num
index += 1
# 请不要更改此行以下的代码
print(get_max(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"492";s:10:"questionid";s:3:"472";s:8:"testtype";s:1:"0";s:8:"... | 690,805 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 15, in <module>
print(get_max(temp_list))
NameError: name 'get_max' is not defined
" | NameError | No error | No error | NameError | NameError | error |
21,726 | 590 | 判断1 | 366 | 补全代码,定义一个函数get_discount(),如果用户的身高小于140(不含),返回票价0,否则返回票价100。
| param = int(input())
def get_discount(height):
if (height < 140):
return 0
else:
return 100
print(get_discount(param)) | 60,681 | todo | param = int(input())
if param<140:
get_discount()=0
else:
get_discount()=100
print(get_discount(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:81:"Sorry: IndentationError: expected an indented block (__tester__.python3, line 4)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandbo... | 264,301 | 2 | 0 | No error | No error | Sorry: IndentationError: expected an indented block (__tester__.python3, line 4)
| IndentationError | IndentationError | IndentationError | error |
1,496 | 60 | 循环1.7 | 85 | 编写一个函数double_until_one_thousand, 将其打印出来后,乘二,直至其大于1000。
| param = int(input())
def double_until_one_thousand(num):
while(num <= 1000):
print(num)
num *= 2
double_until_one_thousand(param) | 2,195 | todo | param = int(input())
# 在此处补全代码
def double_until_one_thousand(x):
return x
while (x<=1000):
x=x*2
double_until_one_thousand(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:2:"71";s:10:"questionid";s:2:"85";s:8:"testtype";s:1:"0";s:8:"te... | 10,297 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
10,456 | 406 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 25,452 | todo | age = int(input())
print("my age is ", age) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:0;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"377";s:10:"questionid";s:3:"339";s:8:"testtype";s:1:"0";s:8:"... | 118,330 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
33,108 | 928 | 变量和赋值 3.5 | 3,018 | 按要求写出代码。
* 要求:
* 用户会输入两个数值,依次是猫的数量num_cats,一个是狗的数量num_dogs。
* 打印猫和狗总共的数量,并创建一个新的空行。
例1:
输入:1 2
输出:3
解释:1 + 2 = 3
例2:
输入:20 20
输出:40
解释:20 + 20 = 40
| total_animals = 0
num_cats = int(input())
num_dogs = int(input())
total_animals = num_cats + num_dogs
print(total_animals) | 123,738 | todo | num_cats = 1
num_dogs = 2
print(num_cats + num_dogs) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:3;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:2;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2285";s:10:"questionid";s:4:"3018";s:8:"testtype";s:1:"0";s:8... | 527,039 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
15,815 | 184 | 字典LAB3 | 560 | 【(附加题)找出第一个重复的字符】
编写一个函数get_first_duplicate(input_str),找出一个String里第一次重复的字符:
例1:
输入: "abbcddeea"
输出: "a"
解释: a在第0位和最后一位, b在第1和第2位, d在第4和第5位, e在第6和第7位, 由于a是第一个出现并重复的字符, 因此返回a
例2:
输入: "abbcd"
输出: "b"
解释: b是唯一重复的, 因此返回b
例3:
输入: "abcd"
输出: ""
解释: 没有重复字符, 返回空字符
如果没有思路请看下面提示
此̶题̶的̶难̶点̶在̶于̶,̶不̶仅̶要̶找̶出̶重̶复̶的̶字̶符̶,̶还̶要... | input_str = input()
# 请不要更改此行以上的代码
def get_first_duplicate(input_str):
pos = len(input_str) + 1
res = ""
position = {}
for i in range(0, len(input_str)):
if input_str[i] in position:
if position[input_str[i]] < pos:
pos = i
res = input_str[i]
... | 42,426 | complete | input_str = input()
# 请不要更改此行以上的代码
# 在这里编写代码
position={}
res=str()
pos=int(len(input_str))
def get_first_duplicate(input_str):
global pos, res
for i in input_str:
if i in position:
if input_str.index(i)<pos:
res=i
pos=input_str.index(i)
... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:7;s:10:"actualmark";d:7;s:11:"testresults";a:7:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"650";s:10:"questionid";s:3:"560";s:8:"testtype";s:1:"0";s:8:"... | 189,809 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
30,893 | 993 | LAB1.2 | 6,216 | 运动中消耗的卡路里是
(年龄的0.2757倍 体重的0.03295倍 心率的1.0781倍 )的和
减去75.4991后,得到的结果乘以时间,再除以 8.368。
补全下列代码,给定了年龄,体重,心率,时间,计算出卡路里的消耗量
| age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
calories_burned = ((age * 0.2757) + (weight * 0.03295) + (heart_rate * 1.0781) - 75.4991) * time / 8.368
print(calories_burned) | 108,947 | todo | age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
x=0.2757*age
y=0.03295*weight
z=1.0781*heart_rate
a=x+y+z-75.4991
b=a*time
calories_burned=b/8.368
# 在此处补全代码
print(calo... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"3178";s:10:"questionid";s:4:"6216";s:8:"testtype";s:1:"0";s:8... | 462,325 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 5, in <module>
age = int(input())
EOFError: EOF when reading a line
" | EOFError | No error | No error | EOFError | EOFError | error |
21,786 | 590 | 判断debug1 | 368 | 以下有一个函数convert_num, 若输入的内容大于10(包括10),则将其减去10。
代码中有错误,请改正其中的错误。
| param = int(input())
def convert_num(input_num):
if (input_num >= 10):
input_num = input_num - 10
print(input_num)
convert_num(param) | 60,772 | todo | param = int(input())
def convert_num(input_num):
if (input_num >= 10):
return(input_num)
input_num = input_num - 10
print(convert_num(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"418";s:10:"questionid";s:3:"368";s:8:"testtype";s:1:"0";s:8:"... | 313,429 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
23,752 | 717 | Lab2.1 | 346 | 定义一个叫做smallest_among_three的函数,输入三个参数,打印最小的参数。
| x = int(input())
y = int(input())
z = int(input())
def smallest_among_three(x, y, z):
if (x < y):
if (x < z):
return x
else:
return z
else:
if (y < z):
return y
else:
return z
print(smallest_among_three(x, y, z)) | 65,543 | todo | x = int(input())
y = int(input())
z = int(input())
a=x
# 在这里补全代码
def smallest_among_three(x,y,z):
if (x>y):
if (y<z):
a=y
else:
a=z
print(a)
smallest_among_three(x, y, z) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:113:" File "__tester__.python3", line 12
print(a)
^
SyntaxError: invalid character in identifier
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"s... | 287,644 | 2 | 0 | No error | No error | File "__tester__.python3", line 12
print(a)
^
SyntaxError: invalid character in identifier
| SyntaxError | SyntaxError | SyntaxError | error |
38,040 | 932 | 列表4.2 | 501 | 请写一个函数sum_of_matrix(),传入一个列表参数my_list,其中有n个长度为m的列表,其中都是格式为string的整数,返回它们的和。
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果。
| line_list = input().split(';')
temp_list = []
for i in line_list:
temp_list.append(i.split(','))
# 请不要更改此行以上的代码
# 在这里编写代码
def sum_of_matrix(my_list):
ret = 0
for i in my_list:
for j in i:
ret += int(j)
return ret
# 请不要更改此行以下的代码
print(sum_of_matrix(temp_list)) | 148,683 | todo | line_list = input().split(';')
temp_list = []
for i in line_list:
temp_list.append(i.split(','))
# 请不要更改此行以上的代码
# 在这里编写代码
def sum_of_matrix(temp_list):
count = 0
for k in range (0, len(temp_list)):
count = count + int(temp_list[k])
return count
# 请不要更改此行以下的代码
print(sum_of_matrix... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"534";s:10:"questionid";s:3:"501";s:8:"testtype";s:1:"0";s:8:"... | 635,762 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 15, in <module>
print(sum_of_matrix(temp_list))
File "__tester__.python3", line 11, in sum_of_matrix
count = count + int(temp_list[k])
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'
" | TypeError | No error | No error | TypeError | TypeError | error |
32,834 | 1,104 | 字典1.2 | 3,925 | 请定义两个字典score_dict和status_dict,存储以下三个人的信息,第一项是score,第二项是status:
john: 90,active
jane: 100, active
james: 0, inactive
| test_param = input()
# 请不要更改此行以上的代码
score_dict = {'john':90, 'jane':100, 'james':0}
status_dict = {'john':'active', 'jane':'active', 'james':'inactive'}
# 请不要更改此行以下的代码
print(score_dict[test_param])
print(status_dict[test_param]) | 122,042 | complete | test_param = input()
# 请不要更改此行以上的代码
score_dict = {'john':'90','jane':'100','james':'0'}
status_dict = {'john':'active','jane':'active','james':'inactive'}
# 请不要更改此行以下的代码
print(score_dict[test_param])
print(status_dict[test_param]) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2525";s:10:"questionid";s:4:"3925";s:8:"testtype";s:1:"0";s:8... | 517,922 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
37,806 | 1,266 | 分支1.7 | 10,438 | 按要求写出代码。
* 要求:
* 把用户输入的一个值转换成int并存入变量num_spiders。
* 如果num_spiders不等于15,给变量web_size赋值为20;
* 否则,给变量web_size赋值为num_spiders。
* 最后,无论num_spiders是多少,都把web_size乘2。
* 打印web_size。
例1:
输入:15
输出:30
解释:num_spiders等于15,所以web_size被赋值为15。最后web_size乘2,所以web_size为30。
例2:
输入:17
输出:40
解释:num_spiders不等于15,所以web_size等于20。最后... | num_spiders = int(input())
if num_spiders != 15:
web_size = 20
else:
web_size = num_spiders
web_size = 2 * web_size
print(web_size) | 148,176 | complete | num_spiders=int(input())
if(num_spiders!=15):
web_size=20
else:
web_size=num_spiders
web_size=web_size*2
print(web_size) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"5294";s:10:"questionid";s:5:"10438";s:8:"testtype";s:1:"0";s:... | 617,021 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
44,752 | 2,085 | 加法 | 326 | 写一行代码,将 功德 (karma) 加一。
如:
karma = 5
则输出
6
| karma = int(input())
karma = karma + 1
print(karma) | 172,531 | complete | karma = int(input())
karma=karma+1# 在这里填写代码
print(karma) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"370";s:10:"questionid";s:3:"326";s:8:"testtype";s:1:"0";s:8:"... | 718,537 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,165 | 304 | 字典LAB2 | 555 | 【考勤计数器】
编写一个程序来记录考勤,包含一个函数:
log_user(user_name) 不返回任何信息,记录user_name的一次到课
print_user_log(user_name) 不返回任何信息,打印user_name到课几次
如:
log_user("Circle")
log_user("Circle")
log_user("Cat")
log_user("Circle")
print_user_log("Circle")
print_user_log("Cat")
print_user_log("Flirter")
结果为:
3
1
0
如果没有思路请看下面提示
第̶一̶步̶:̶定̶义... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def log_user(user_name):
if user_name in user_info:
user_info[user_name] += 1
else:
user_info[user_name] = 1
def print_user_log(user_name):
if user_name in user_info:
print(user_info[user_name]... | 34,143 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
user_info = {}
def log_user(user_name):
user_info[user_name] = 0
if user_name in user_info:
user_info[user_name] += 1
def print_user_log(user_name):
if user_name in user_info:
user_info[user_name] += 1... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:3;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:2;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"624";s:10:"questionid";s:3:"555";s:8:"testtype";s:1:"0";s:8:"... | 175,968 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
38,385 | 882 | 函数1.0 | 6,231 | 定义一个叫做 WELCOME_TO_CIRCLE_CAT() 的函数,它的内容是打印以下这句话
"Welcome to circle cat!"
并使用这个函数2次(不包含题目内的一次)。
| def welcome_to_circle_cat():
print("Welcome to circle cat!")
welcome_to_circle_cat()
welcome_to_circle_cat()
# 请不要更改此行以下的代码
welcome_to_circle_cat() | 150,132 | complete | def welcome_to_circle_cat():
print("Welcome to circle cat!")
welcome_to_circle_cat()
welcome_to_circle_cat()
# 请不要更改此行以下的代码
welcome_to_circle_cat() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"3190";s:10:"questionid";s:4:"6231";s:8:"testtype";s:1:"0";s:8... | 626,769 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
7,284 | 311 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 14,038 | todo | age = int(input())
print(\"my age is " \+ age) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:169:" File "__tester__.python3", line 3
print(\"my age is " \+ age)
^
SyntaxError: unexpected character after line continuation character
";s:11:"maxpossmark... | 72,805 | 2 | 0 | No error | No error | File "__tester__.python3", line 3
print(\"my age is " \+ age)
^
SyntaxError: unexpected character after line continuation character
| SyntaxError | SyntaxError | SyntaxError | error |
15,368 | 474 | 成员&标识 | 3,418 | 按要求写出代码。
* 要求:
* 已经给出列表my_list。
* 把用户输入的值转换成int存入变量my_guess。
* 如果my_guess在my-list里,打印'猜对了';
* 否则,打印'猜错了'。
例1:
输入:75
输出:猜对了
解释:75在列表中。
例2:
输入:19
输出:猜错了
解释:19不在列表中。
| my_list = [10, 75, 94]
my_guess = int(input())
if my_guess in my_list:
print('猜对了')
else:
print('猜错了') | 40,492 | complete | my_list = [10, 75, 94]
my_guess=int(input())
if my_guess in my_list:
print("猜对了")
else:
print("猜错了") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2395";s:10:"questionid";s:4:"3418";s:8:"testtype";s:1:"0";s:8... | 199,858 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
44,820 | 362 | 输入和输出 1.2 | 2,860 | 打印字符串:
I am Python!
| print("I am Python!") | 172,740 | complete | print("I am Python!") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2224";s:10:"questionid";s:4:"2860";s:8:"testtype";s:1:"0";s:8... | 719,547 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
4,172 | 51 | 字典LAB1 | 256 | 【用户名密码验证】
编写一个程序做到添加/验证用户名密码,包含两个函数:
add_user(user_name, pass_word) 不返回任何信息,用于添加一个用户,用户名是user_name,密码是pass_word
verify_user(user_name, pass_word)返回Boolean值(代表用户名密码是否正确),如果存在用户名为user_name,密码为pass_word的用户,则返回True,密码错误或者用户不存在则返回False
如:
add_user("circle", "cat")
print(verify_user("circle","cat"))
print(verify_user("... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
return... | 6,856 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
def add_user(user_name,pass_word):
user_infor[user_name]=pass_word
def verify_user(user_name,pass_word):
if user_name in user_infor:
if pass_word==user_infor[user_name]:
return True
return False
# ... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"258";s:10:"questionid";s:3:"256";s:8:"testtype";s:1:"0";s:8:"... | 38,601 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 16, in <module>
add_user(i[0], i[1])
File "__tester__.python3", line 7, in add_user
user_infor[user_name]=pass_word
NameError: name 'user_infor' is not defined
" | NameError | No error | No error | NameError | NameError | error |
6,057 | 79 | 递归2.3 | 593 | 用递归编写一个函数x_power_of_y(x, y)计算x的y次方。
如x_power_of_y(2, 3) 应返回2的3次方,即8;
x_power_of_y(3, 2) 应返回3的2次方,即9;
x_power_of_y(4, 3) 应返回4的3次方,即64。
| input_x = int(input())
input_y = int(input())
# 请不要更改此行以上的代码
def x_power_of_y(x, y):
if x == 0:
return 0
if y == 0:
return 1
else:
return x * x_power_of_y(x, y - 1)
# 请不要更改此行以下的代码
print(x_power_of_y(input_x, input_y)) | 11,678 | complete | input_x = int(input())
input_y = int(input())
# 请不要更改此行以上的代码
def x_power_of_y(x, y):
# 在此补充
if y == 0:
# 在此补充
return 1
else:
return x * x_power_of_y(x, y - 1)
# 请不要更改此行以下的代码
print(x_power_of_y(input_x, input_y)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"676";s:10:"questionid";s:3:"593";s:8:"testtype";s:1:"0";s:8:"... | 59,717 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
8,392 | 195 | 输入和输出 1.9 | 2,923 | 按要求写出代码。
* 要求:
* 把用户输入的三个数先转换成整数形式,分别存储给不同的变量。
* 求出这三个变量的和,并打印。
例1:
输入:1 2 3
输出:2
解释:1 + 2 + 3 = 6
例2:
输入:6 7 8
输出:7
解释:6 + 7 + 8 = 21
| a = int(input())
b = int(input())
c = int(input())
print(a+b+c) | 18,164 | todo | a=int(input())
b=int(input())
c=int(input())
print=(a+b+c) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2247";s:10:"questionid";s:4:"2923";s:8:"testtype";s:1:"0";s:8... | 92,939 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
8,867 | 173 | 循环LAB1 | 397 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 20,382 | complete | param = input()
# 在此处编写代码
def reverse_string(x):
reverse_s = ''
for i in range(len(x)-1,-1,-1):
reverse_s += x[i]
return reverse_s
print(reverse_string(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:4;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"456";s:10:"questionid";s:3:"397";s:8:"testtype";s:1:"0";s:8:"... | 101,063 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
21,794 | 590 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 60,773 | complete | param = int(input())
def print_num(param):
if (param == 10):
return(param)
else:
return('')
print(print_num(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"423";s:10:"questionid";s:3:"369";s:8:"testtype";s:1:"0";s:8:"... | 313,464 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
27,033 | 801 | 循环1.7 | 2,432 | 编写一个函数double_until_one_thousand, 将其打印出来后,乘二,再打印,直至其大于1000。
| param = int(input())
def double_until_one_thousand(num):
while(num <= 1000):
print(num)
num *= 2
double_until_one_thousand(param) | 75,764 | todo | param = int(input())
def double_until_one_thousand(x):
while(x<=1000):
print(x)
x=x*2
if x <= 1000:
print(x)
double_until_one_thousand(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:4;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:1;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2074";s:10:"questionid";s:4:"2432";s:8:"testtype";s:1:"0";s:8... | 337,744 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
13,630 | 143 | 分支1.7 | 3,129 | 按要求写出代码。
* 要求:
* 把用户输入的一个值转换成int并存入变量num_spiders。
* 如果num_spiders不等于15,给变量web_size赋值为20;
* 否则,给变量web_size赋值为num_spiders。
* 最后,无论num_spiders是多少,都把web_size乘2。
* 打印web_size。
例1:
输入:15
输出:30
解释:num_spiders不等于15,所以web_size被赋值为15。最后web_size乘2,所以web_size为30。
例2:
输入:17
输出:40
解释:num_spiders不等于15,所以web_size等于15。最... | num_spiders = int(input())
if num_spiders != 15:
web_size = 20
else:
web_size = num_spiders
web_size = 2 * web_size
print(web_size) | 35,422 | todo | num_spiders=int(input('请输入数字:'))
web_size=1
if num_spiders!=15:
web_size=20
else:
web_size=num_spiders
web_size = web_size * 2
print(web_size) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2330";s:10:"questionid";s:4:"3129";s:8:"testtype";s:1:"0";s:8... | 162,068 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
47,302 | 2,204 | 输入和输出 1.8 | 3,474 | 按要求写出代码。
* 要求:
* 把用户输入的两个值转换成整数型,并分别存储。
* 打印这两个输入值的和。
例1:
输入:3 4
输出:7
解释:3 + 4 = 7
例2:
输入:9 10
输出:19
解释:9 + 10 = 19
| num1 = int(input())
num2 = int(input())
print (num1 + num2) | 181,717 | complete | a=int(input())
b=int(input())
num=a+b
print(num) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2410";s:10:"questionid";s:4:"3474";s:8:"testtype";s:1:"0";s:8... | 753,287 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
45,100 | 2,084 | 字典LAB1 | 553 | 【用户名密码验证】
编写一个程序做到添加/验证用户名密码,包含两个函数:
add_user(user_name, pass_word) 不返回任何信息,用于添加一个用户,用户名是user_name,密码是pass_word
verify_user(user_name, pass_word)返回Boolean值(代表用户名密码是否正确),如果存在用户名为user_name,密码为pass_word的用户,则返回True,密码错误或者用户不存在则返回False
如:
add_user("circle", "cat")
print(verify_user("circle","cat"))
print(verify_user("... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
return False
# 请不要... | 173,204 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
def add_user(user_name,pass_word):
user_database[user_name] = pass_word
def verify_user_(user_name,pass_word):
if user_name in user_database and user_database[user_name]==pass_word:
return Turn
else :
return F... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"616";s:10:"questionid";s:3:"553";s:8:"testtype";s:1:"0";s:8:"... | 721,452 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 16, in <module>
add_user(i[0], i[1])
File "__tester__.python3", line 7, in add_user
user_database[user_name] = pass_word
NameError: name 'user_database' is not defined
" | NameError | No error | No error | NameError | NameError | error |
34,046 | 916 | 判断1 | 366 | 补全代码,定义一个函数get_discount(),如果用户的身高小于140(不含),返回票价0,否则返回票价100。
| param = int(input())
def get_discount(height):
if (height < 140):
return 0
else:
return 100
print(get_discount(param)) | 128,279 | todo | param = int(150)
def get_discount(param):
if param < 140:
return"0"
else: return"100"
print(get_discount(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:3;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:2;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"408";s:10:"questionid";s:3:"366";s:8:"testtype";s:1:"0";s:8:"... | 554,441 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
1,248 | 79 | 循环3.4 | 95 | 编写一个函数count_ones,输入一个int,数有几位1。
例:
输入:100010010
返回:3
| param = int(input())
def count_ones(param):
count = 0
for i in str(param):
if i == "1":
count += 1
return count
print(count_ones(param)) | 1,838 | todo | param = int(input())
# 在此处编写代码
def count_ones(s):
n = 0
for i in range(s):
if str(i) != str(1):
continue
n += 1
print(n)
print(count_ones(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:2:"94";s:10:"questionid";s:2:"95";s:8:"testtype";s:1:"0";s:8:"te... | 8,843 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
7,445 | 317 | 函数1.0 | 402 | 定义一个叫做 WELCOME_TO_CIRLCLE_CAT() 的函数,它的内容是打印以下这句话
"Welcome to circle cat!"
并使用这个函数2次(不包含题目内的一次)。
| def welcome_to_cirlcle_cat():
print("Welcome to circle cat!")
welcome_to_cirlcle_cat()
welcome_to_cirlcle_cat()
# 请不要更改此行以下的代码
welcome_to_cirlcle_cat() | 14,585 | complete | # 在这里编写代码
def welcome_to_cirlcle_cat():
print ("Welcome to circle cat!")
# 请不要更改此行以下的代码
welcome_to_cirlcle_cat()
welcome_to_cirlcle_cat()
welcome_to_cirlcle_cat() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"476";s:10:"questionid";s:3:"402";s:8:"testtype";s:1:"0";s:8:"... | 74,705 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
41,210 | 414 | 字典LAB1 | 553 | 【用户名密码验证】
编写一个程序做到添加/验证用户名密码,包含两个函数:
add_user(user_name, pass_word) 不返回任何信息,用于添加一个用户,用户名是user_name,密码是pass_word
verify_user(user_name, pass_word)返回Boolean值(代表用户名密码是否正确),如果存在用户名为user_name,密码为pass_word的用户,则返回True,密码错误或者用户不存在则返回False
如:
add_user("circle", "cat")
print(verify_user("circle","cat"))
print(verify_user("... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
return False
# 请不要... | 159,770 | complete | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
user_info={}
def add_user(user_name,pass_word):
user_info[user_name] = pass_word
def verify_user(user_name,pass_word):
if user_name in user_info and user_info[user_name] == pass_word:
return True
else:
r... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"616";s:10:"questionid";s:3:"553";s:8:"testtype";s:1:"0";s:8:"... | 724,463 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
25,491 | 458 | 列表LAB3 | 544 | 请写一个函数add_matrix(),传入两个二维列表参数matrix_1, matrix_2; 其中每个有n个长度为m的列表,其中都是int,返回一个二维列表,内容是前两个列表的和(对应的位置相加)。
例1:
输入
matrix_1 = [[7, 8],
[4, 1]]
matrix_2 = [[3, 7],
[4, 3]]
返回
[[10, 15],
[8, 4]]
例2:
输入
matrix_1 = [[0]]
matrix_2 = [[1]]
返回
[[1]]
例3:
输入
matrix_1 = [[1, 1, 1],
[2, 1... | import ast
input_list_1 = ast.literal_eval(input())
input_list_2 = ast.literal_eval(input())
# 请不要更改此行以上的代码
def add_matrix(matrix_1, matrix_2):
for i in range(0, len(matrix_1)):
for j in range(0, len(matrix_1[i])):
matrix_1[i][j] = matrix_1[i][j] + matrix_2[i][j]
return matrix_1
# 请不要更改此行以... | 70,188 | todo | import ast
input_list_1 = ast.literal_eval(input())
input_list_2 = ast.literal_eval(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def add_matrix(input_list_1,input_list_2):
for i in range(len(input_list_1)):
for j in range(len(input_list_1)):
input_list_1[i][j]
for i in range(len(input_list_2... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"565";s:10:"questionid";s:3:"544";s:8:"testtype";s:1:"0";s:8:"... | 314,248 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 17, in <module>
print(add_matrix(input_list_1, input_list_2))
File "__tester__.python3", line 14, in add_matrix
input_list[i][j]=input_list_1[i][j]+input_list_2[i][j]
NameError: name 'input_list' is not defined
" | NameError | No error | No error | NameError | NameError | error |
33,613 | 1,131 | 输入和输出 1.2 | 2,860 | 打印字符串:
I am Python!
| print("I am Python!") | 125,830 | complete | print('I am Python!') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2224";s:10:"questionid";s:4:"2860";s:8:"testtype";s:1:"0";s:8... | 533,910 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
30,220 | 139 | 硬币数 | 2,054 | 补全以下代码,将所有种类硬币的和打印出来。
注:题目中的yuan / jiao是硬币种类的拼音,没有其他含义。
| num_yuan = int(input())
num_jiao = int(input())
num_coins = num_yuan + num_jiao
print(num_coins) | 102,769 | todo | num_yuan = int(input())
num_jiao = int(input())
# 在这里填写代码
num_coins='num_yuan'+'num_jiao'
print(num_coins) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:0;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"1810";s:10:"questionid";s:4:"2054";s:8:"testtype";s:1:"0";s:8... | 439,273 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
8,935 | 312 | 递归1.2 | 572 | 补全代码,使其打印出还有几天到周日。
例如输入3,则打印
还有4天到周日
还有3天到周日
还有2天到周日
还有1天到周日
到周日了!
| input_int = int(input())
# 请不要更改此行以上的代码
def days_left_to_sunday(day):
if day < 7:
print("还有" + str(7 - day) + "天到周日")
days_left_to_sunday(day + 1)
else:
print("到周日了!")
# 请不要更改此行以下的代码
days_left_to_sunday(input_int) | 20,559 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def days_left_to_sunday(day):
if day < 7:
print("还有" + str(7 - day) + "天到周日")
days_left_to_sunday(day-1)
else:
print("到周日了!")
# 请不要更改此行以下的代码
days_left_to_sunday(input_int) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:1;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"663";s:10:"questionid";s:3:"572";s:8:"testtype";s:1:"0";s:8:"... | 99,229 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 12, in <module>
days_left_to_sunday(input_int)
File "__tester__.python3", line 7, in days_left_to_sunday
days_left_to_sunday(day-1)
File "__tester__.python3", line 7, in days_left_to_sunday
days_left_to_sunday(day-1)
File... | RecursionError | No error | No error | RecursionError | RecursionError | error |
12,116 | 242 | LAB1.0 | 342 | 补全以下代码,使其打印x被y除三次,并打印每次的结果。
如:
x = 8
y = 2
则输出:
4.0
2.0
1.0
| x = int(input())
y = int(input())
x /= y
print(x)
x /= y
print(x)
x /= y
print(x) | 31,373 | todo | x = int(input())
y = int(input())
a=x/y
b=a/y
c=b/y
print(a\nb\nc)
| O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:143:" File "__tester__.python3", line 6
print(a\nb\nc)
^
SyntaxError: unexpected character after line continuation character
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:... | 142,057 | 2 | 0 | No error | No error | File "__tester__.python3", line 6
print(a\nb\nc)
^
SyntaxError: unexpected character after line continuation character
| SyntaxError | SyntaxError | SyntaxError | error |
45,111 | 2,084 | 字典LAB3 | 560 | 【(附加题)找出第一个重复的字符】
编写一个函数get_first_duplicate(input_str),找出一个String里第一次重复的字符:
例1:
输入: "abbcddeea"
输出: "a"
解释: a在第0位和最后一位, b在第1和第2位, d在第4和第5位, e在第6和第7位, 由于a是第一个出现并重复的字符, 因此返回a
例2:
输入: "abbcd"
输出: "b"
解释: b是唯一重复的, 因此返回b
例3:
输入: "abcd"
输出: ""
解释: 没有重复字符, 返回空字符
如果没有思路请看下面提示
此̶题̶的̶难̶点̶在̶于̶,̶不̶仅̶要̶找̶出̶重̶复̶的̶字̶符̶,̶还̶要... | input_str = input()
# 请不要更改此行以上的代码
def get_first_duplicate(input_str):
pos = len(input_str) + 1
res = ""
position = {}
for i in range(0, len(input_str)):
if input_str[i] in position:
if position[input_str[i]] < pos:
pos = i
res = input_str[i]
... | 173,206 | todo | input_str = input()
# 请不要更改此行以上的代码
def get_first_duplicate(input_str):
seen_chars = set() # 用于存储已经出现过的字符
for char in input_str:
if char in seen_chars:
return char
else:
seen_chars.add(char)
return ""
# 请不要更改此行以下的代码
print(get_first_duplicate(input_... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:7;s:10:"actualmark";d:5;s:11:"testresults";a:7:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"650";s:10:"questionid";s:3:"560";s:8:"testtype";s:1:"0";s:8:"... | 721,479 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
4,503 | 50 | 递归1.2 | 294 | 补全代码,使其打印出还有几天到周日。
例如输入3,则打印
还有4天到周日
还有3天到周日
还有2天到周日
还有1天到周日
到周日了!
| input_int = int(input())
# 请不要更改此行以上的代码
def days_left_to_sunday(day):
if day < 7:
print("还有" + str(7 - day) + "天到周日")
days_left_to_sunday(day + 1)
else:
print("到周日了!")
# 请不要更改此行以下的代码
days_left_to_sunday(input_int) | 7,163 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def days_left_to_sunday(day):
if day < 7:
print("还有" + str(7 - day) + "天到周日")
#在这里添加一行代码
days_left_to_sunday(day-1)
else:
print("到周日了!")
# 请不要更改此行以下的代码
days_left_to_sunday(input_int) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:1;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"304";s:10:"questionid";s:3:"294";s:8:"testtype";s:1:"0";s:8:"... | 38,488 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 13, in <module>
days_left_to_sunday(input_int)
File "__tester__.python3", line 8, in days_left_to_sunday
days_left_to_sunday(day-1)
File "__tester__.python3", line 8, in days_left_to_sunday
days_left_to_sunday(day-1)
File... | RecursionError | No error | No error | RecursionError | RecursionError | error |
31,651 | 282 | 循环LAB3 | 399 | 编写一个函数count_spaces_and_commas,打印出有几个空格和逗号。
例如:
输入: 你好,我的名字叫 逗猫师。
打印: 有1个逗号和1个空格
输入:我 你 她
打印:有0个逗号和2个空格
输入:,,,
打印:有3个逗号和0个空格
| param = input()
def count_spaces_and_commas(s):
num_spaces = 0
num_commas = 0
for i in s:
if i == " ":
num_spaces += 1
if i == ",":
num_commas += 1
print("有"+ str(num_commas) +"个逗号和" + str(num_spaces) + "个空格")
count_spaces_and_commas(param) | 115,510 | todo | param = input()
# 在此处编写代码
def count_spaces_and_commas(param):
a=0
b=0
for i in param:
if i==",":
a=a+1
elif i==" ":
b=b+1
print("有"+str(a)+"个逗号和"+str(b)+"个空格")
count_spaces_and_commas(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:107:"Sorry: IndentationError: unindent does not match any outer indentation level (__tester__.python3, line 12)
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sou... | 484,910 | 2 | 0 | No error | No error | Sorry: IndentationError: unindent does not match any outer indentation level (__tester__.python3, line 12)
| IndentationError | IndentationError | IndentationError | error |
40,247 | 1,226 | 2.5 | 2,974 | 把下面代码中的语法错误改好,重新写出来。
print('I can")
print(swim.)
my_age = 10
print('my age:' my_age)
| print('I can')
print('swim.')
my_age = 10
print('my age:', my_age) | 155,639 | todo | print('I can")
print('swim.')
my_age=print('10')
print('my age:'+my_age) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:122:" File "__tester__.python3", line 1
print('I can")
^
SyntaxError: EOL while scanning string literal
";s:11:"maxpossmark";d:1;s:10:"actualmark";i:0;s:11:"testresults";... | 651,682 | 2 | 0 | No error | No error | File "__tester__.python3", line 1
print('I can")
^
SyntaxError: EOL while scanning string literal
| SyntaxError | SyntaxError | SyntaxError | error |
28,063 | 878 | 输入和输出 1.8 | 3,474 | 按要求写出代码。
* 要求:
* 把用户输入的两个值转换成整数型,并分别存储。
* 打印这两个输入值的和。
例1:
输入:3 4
输出:7
解释:3 + 4 = 7
例2:
输入:9 10
输出:19
解释:9 + 10 = 19
| num1 = int(input())
num2 = int(input())
print (num1 + num2) | 82,541 | todo | a=int(input("3"))
a=int(input("4"))
print(a+b) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2410";s:10:"questionid";s:4:"3474";s:8:"testtype";s:1:"0";s:8... | 371,409 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 3, in <module>
print(a+b)
NameError: name 'b' is not defined
" | NameError | No error | No error | NameError | NameError | error |
4,523 | 20 | 递归1.2 | 294 | 补全代码,使其打印出还有几天到周日。
例如输入3,则打印
还有4天到周日
还有3天到周日
还有2天到周日
还有1天到周日
到周日了!
| input_int = int(input())
# 请不要更改此行以上的代码
def days_left_to_sunday(day):
if day < 7:
print("还有" + str(7 - day) + "天到周日")
days_left_to_sunday(day + 1)
else:
print("到周日了!")
# 请不要更改此行以下的代码
days_left_to_sunday(input_int) | 7,175 | complete | input_int = int(input())
# 请不要更改此行以上的代码
def days_left_to_sunday(day):
if day < 7:
print("还有" + str(7 - day) + "天到周日")
days_left_to_sunday(day+1)
else:
print("到周日了!")
# 请不要更改此行以下的代码
days_left_to_sunday(input_int) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"304";s:10:"questionid";s:3:"294";s:8:"testtype";s:1:"0";s:8:"... | 37,458 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
41,682 | 1,350 | 列表3.3 | 476 | 请编写一个函数palindrome(),传入一个列表参数my_list,其中的值都是长度为1的string,返回一个boolean,判断在去掉最后一位和第一位后,该列表是否是回文。
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果(可以更改原列表的内容)。
| temp_list = input().split(',')
# 请不要更改此行以上的代码
def palindrome(my_list):
my_list.pop()
my_list.remove(my_list[0])
return my_list == my_list[::-1]
# 请不要更改此行以下的代码
print(palindrome(temp_list)) | 161,110 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def palindrome(l):
del l[0]
del l[-1]
for i in range(0, int(len(l)/2) ):
if l[i]==l[-(i+1)]:
return True
else:
return False
# 请不要更改此行以下的代码
print(palindrome(te... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:6;s:11:"testresults";a:8:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"514";s:10:"questionid";s:3:"476";s:8:"testtype";s:1:"0";s:8:"... | 675,586 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
39,689 | 1,153 | 列表3.2 | 474 | 请编写一个函数count_negative(),传入一个列表参数my_list,其中的值都是格式为string的整数,返回该列表里负数的个数。
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果。
| temp_list = input().split(',')
# 请不要更改此行以上的代码
def count_negative(my_list):
count = 0
for i in my_list:
if int(i) < 0:
count += 1
return count
# 请不要更改此行以下的代码
print(count_negative(temp_list)) | 154,145 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
my_list=temp_list
def count_negative(my_list):
count=0
for i in my_list:
if i<0:
count+=1
return count
# 在这里编写代码
# 请不要更改此行以下的代码
print(count_negative(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"501";s:10:"questionid";s:3:"474";s:8:"testtype";s:1:"0";s:8:"... | 643,571 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 13, in <module>
print(count_negative(temp_list))
File "__tester__.python3", line 7, in count_negative
if i<0:
TypeError: '<' not supported between instances of 'str' and 'int'
" | TypeError | No error | No error | TypeError | TypeError | error |
8,724 | 41 | 块&缩进 6.2 | 3,464 | 把下面的代码改成正确的缩进形式,补在题目中标明的位置。
1
2
3
4
5
6
7
if num_spiders > 10:
if num_cats > num_spiders:
print("猫会吃掉蜘蛛")
else:
print("猫吃不完蜘蛛")
else:
print('蜘蛛很少')
* 要求:
* 当num_spiders大于10时,如果num_cats大于num_spiders,则打印‘猫会吃掉蜘蛛’
* 当num_spiders大于10时,如果num_cats小于或等于num_spiders,则打印'猫吃不完蜘蛛'
* 当num_spiders小于或等于10时,打印'蜘蛛很少'。
例1:
输入... | num_spiders = int(input())
num_cats = int(input())
if num_spiders > 10:
if num_cats > num_spiders:
print("猫会吃掉蜘蛛")
else:
print("猫吃不完蜘蛛")
else:
print('蜘蛛很少') | 19,636 | complete | num_spiders = int(input())
num_cats = int(input())
if num_spiders > 10:
if num_cats > num_spiders:
print("猫会吃掉蜘蛛")
else:
print("猫吃不完蜘蛛")
else:
print('蜘蛛很少') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2405";s:10:"questionid";s:4:"3464";s:8:"testtype";s:1:"0";s:8... | 141,293 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
47,936 | 2,276 | LAB1.2 | 6,216 | 运动中消耗的卡路里是
(年龄的0.2757倍 体重的0.03295倍 心率的1.0781倍 )的和
减去75.4991后,得到的结果乘以时间,再除以 8.368。
补全下列代码,给定了年龄,体重,心率,时间,计算出卡路里的消耗量
| age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
calories_burned = ((age * 0.2757) + (weight * 0.03295) + (heart_rate * 1.0781) - 75.4991) * time / 8.368
print(calories_burned) | 183,069 | todo | age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
calories_burned=((0.2757*age+0.03295*weight+1.0781*heart_rate)-75.4991)*time# 在此处补全代码
print(calories_burned) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:0;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"3178";s:10:"questionid";s:4:"6216";s:8:"testtype";s:1:"0";s:8... | 759,728 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
40,933 | 461 | 范围 3.6 | 3,279 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int,存入film_rate。
* 如果film_rate大于7,打印'好看';
* 否则,打印'不好看'。
例1:
输入:8
输出:好看
解释:8 > 7,所以打印'好看'。
例2:
输入:7
输出:不好看
解释:7 = 7,不符合大于7的条件。所以打印'不好看'。
| film_rate = int(input())
if film_rate > 7:
print('好看')
else:
print('不好看')
| 158,562 | complete | film_rate=int(input())
if film_rate>7:
print("好看")
else:
print("不好看") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2340";s:10:"questionid";s:4:"3279";s:8:"testtype";s:1:"0";s:8... | 664,177 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
47,062 | 2,257 | 循环2.3 | 388 | 补全以下代码,使其打印0到5的所有值。
| for i in range(0, 10):
print(i)
if (i == 5):
break | 181,032 | complete | for i in range(0, 10):
print(i)
if i==5:
break | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"431";s:10:"questionid";s:3:"388";s:8:"testtype";s:1:"0";s:8:"... | 751,132 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
36,812 | 1,267 | 输入和输出 1.10 | 2,925 | 按要求写出代码。
* 要求:
* 打印:"生日快乐!"(不打印引号)
| print("生日快乐!") | 145,770 | complete | input("生日快乐!") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2253";s:10:"questionid";s:4:"2925";s:8:"testtype";s:1:"0";s:8... | 606,982 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
27,080 | 692 | 列表1.6 | 445 | 将输入的input_list_0, input_list_1连起来赋值给一个新的变量my_list, 并将my_list里的第0项删除,再将新的第0项设置为'x'。
| input_list_0 = input().split(',')
input_list_1 = input().split(',')
# 请不要更改此行以上的代码
my_list = input_list_0 + input_list_1
del my_list[0]
my_list[0] = 'x'
# 请不要更改此行以下的代码
print(",".join(my_list)) | 75,904 | complete | input_list_0 = input().split(',')
input_list_1 = input().split(',')
# 请不要更改此行以上的代码
my_list = input_list_0 + input_list_1
del my_list[0]
my_list[0] = "x"
# 请不要更改此行以下的代码
print(",".join(my_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"477";s:10:"questionid";s:3:"445";s:8:"testtype";s:1:"0";s:8:"... | 337,858 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
41,608 | 1,350 | 判断2 | 367 | 定义一个函数get_age_status,
输入年龄,如果在0至18(不含),打印“未成年人”;
如果在18-65(不含),打印“工作中”;
如果在65以上,打印“退休了”。
| param = int(input())
def get_age_status(age):
if age < 18:
return "未成年人"
elif age < 65:
return "工作中"
else:
return "退休了"
print(get_age_status(param)) | 160,954 | complete | param = int(input())
# 在此补全代码
def get_age_status(age):
if 0<age<18:
return "未成年人"
elif age<65:
return "工作中"
else:
return "退休了"
print(get_age_status(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"413";s:10:"questionid";s:3:"367";s:8:"testtype";s:1:"0";s:8:"... | 674,180 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.