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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,550 | 184 | 循环LAB1 | 397 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 12,332 | todo | param = input()
def reverse_string(param):
a=len(param)-1
b=""
while(True):
b=b+param[a]
a=a-1
if a<0:
break
print(b)
| 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:97:"Sorry: TabError: inconsistent use of tabs and spaces in indentation (__tester__.python3, line 9)
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist... | 71,351 | 2 | 0 | No error | No error | Sorry: TabError: inconsistent use of tabs and spaces in indentation (__tester__.python3, line 9)
| TabError | TabError | TabError | error |
35,370 | 1,168 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 138,036 | todo | print_num = int(input())
def print_num():
if(print_num==10):
print(print_num)
| 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:2;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:"... | 580,561 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
22,945 | 701 | 列表LAB2 | 543 | 编写一个count_numbers()函数,传入一个参数:input_list (string格式的个位整数),
在此函数中,新建一个10位长的列表,每一位代表input_list内含有此位数的个数,并返回这个列表。
例1:
input_list = ['1', '0', '7', '7', '8', '3']
则返回 [1, 1, 0, 1, 0, 0, 0, 2, 1, 0]
input_list内含1个0,因此返回列表的第0位为1;
内含1个1,因此返回列表的第1位为1;
内含2个7,因此返回列表的第7位为2;
内含1个3,因此返回列表的第3位为1;
内含1个8,因此返回列表的第8位为1。
例2:
inp... | input_list = input().split(',')
# 请不要更改此行以上的代码
def count_numbers(input_list):
res = [0,0,0,0,0,0,0,0,0,0]
for i in input_list:
res[int(i)] += 1
return res
# 请不要更改此行以下的代码
print(count_numbers(input_list)) | 63,256 | complete | input_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def count_numbers(input_list):
list = [a,a,a,a,a,a,a,a,a]
a0 = 0
a1 = 0
a2 = 0
a3 = 0
a4 = 0
a5 = 0
a6 = 0
a7 = 0
a8 = 0
a9 = 0
for i in range (len(input_list)):
if input_list[i] == str(0):
... | 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:6;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"559";s:10:"questionid";s:3:"543";s:8:"testtype";s:1:"0";s:8:"... | 280,771 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 41, in <module>
print(count_numbers(input_list))
File "__tester__.python3", line 6, in count_numbers
list = [a,a,a,a,a,a,a,a,a]
NameError: name 'a' is not defined
" | NameError | No error | No error | NameError | NameError | error |
22,307 | 617 | 变量和赋值 3.6 | 3,020 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int并乘3。
* 打印出新的值,并创建一个新的空行。
例1:
输入:1
输出:3
解释:1 * 3 = 3
例2:
输入:5
输出:15
解释:5 * 3 = 15
| my_val = int(input())
my_val = my_val * 3
print(my_val) | 61,716 | complete | a=int(input())
b=a*3
print(b)
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:"2295";s:10:"questionid";s:4:"3020";s:8:"testtype";s:1:"0";s:8... | 269,854 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
1,821 | 26 | 判断2 | 70 | 定义一个函数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)) | 2,666 | complete | param = int(input())
# 在此补全代码
def get_age_status(self):
if param>=0 and param<18:
return ("未成年人")
elif param>=18 and param<65:
return ("工作中")
elif param>=65:
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:2:"53";s:10:"questionid";s:2:"70";s:8:"testtype";s:1:"0";s:8:"te... | 14,392 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
22,077 | 774 | 判断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)) | 61,371 | todo | param = int(input())
def get_discount():
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: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:"408";s:10:"questionid";s:3:"366";s:8:"testtype";s:1:"0";s:8:"... | 268,057 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 7, in <module>
print(get_discount(param))
TypeError: get_discount() takes 0 positional arguments but 1 was given
" | TypeError | No error | No error | TypeError | TypeError | error |
41,790 | 1,360 | 输入和输出 1.11 | 2,928 | 按要求写出代码。
* 要求:
* 打印:
你好
我在吃饭
(注意最后有一个空行)
| print("你好")
print("我在吃饭") | 161,504 | complete | print("你好")
print("我在吃饭",end="") | 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... | 676,673 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
2,268 | 50 | 循环LAB1 | 96 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 3,231 | complete | param = input()
def reverse_string(param):
b=param[::-1]
return b
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:2:"99";s:10:"questionid";s:2:"96";s:8:"testtype";s:1:"0";s:8:"te... | 18,129 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
23,316 | 701 | 字典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]
... | 64,015 | todo | input_str = input()
# 请不要更改此行以上的代码
# 在这里编写代码
def get_first_duplicate(input_str):
res = ''
position = {}
pos = -1
for j in input_str:
pos += 1
if j not in position:
position[j] = pos
elif position [j] < pos:
res = j
print(res)
# 请不要更改此行以下的代码
print(get_first_... | 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:98:"Sorry: TabError: inconsistent use of tabs and spaces in indentation (__tester__.python3, line 15)
";s:11:"maxpossmark";d:7;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelis... | 285,780 | 2 | 0 | No error | No error | Sorry: TabError: inconsistent use of tabs and spaces in indentation (__tester__.python3, line 15)
| TabError | TabError | TabError | error |
548 | 49 | 判断debug2 | 72 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 702 | todo | param = int(input())
def print_num(input_num):
if (input_num = 10):
print(input_num)
else:
pass
print_num(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:110:" File "__tester__.python3", line 4
if (input_num = 10):
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"... | 2,984 | 2 | 0 | No error | No error | File "__tester__.python3", line 4
if (input_num = 10):
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
20,614 | 771 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 58,119 | complete | 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: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:"2226";s:10:"questionid";s:4:"2862";s:8:"testtype";s:1:"0";s:8... | 252,751 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
42,377 | 1,339 | 列表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)) | 162,561 | todo | line_list = input().split(';')
temp_list = []
for i in line_list:
temp_list.append(i.split(','))
# 请不要更改此行以上的代码
# 在这里编写代码
def sum_of_matrix(my_list):
sum = 0
for x in range(0,n):
for j in range(0,m):
sum += my_list[x][j]
return(sum)
# 请不要更改此行以下的代码
print(sum_of_ma... | 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:"... | 685,791 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 16, in <module>
print(sum_of_matrix(temp_list))
File "__tester__.python3", line 10, in sum_of_matrix
for x in range(0,n):
NameError: name 'n' is not defined
" | NameError | No error | No error | NameError | NameError | error |
30,398 | 612 | 循环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) | 103,563 | todo | param = input()
# 在此处编写代码
def count_spaces_and_commas(param):
num0 = 0
num1 = 0
for i in param:
if i != ',':
continue
num0 +=1
elif i != ' ':
continue
num1 +=1
print('有'+str(num0)+'个逗号和'+str(num1)+'个空格')
count_spaces_and_... | 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 12
elif i != ' ':
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:... | 546,589 | 2 | 0 | No error | No error | File "__tester__.python3", line 12
elif i != ' ':
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
41,870 | 1,365 | 输入和输出 1.9 | 6,215 | 按要求写出代码。
* 要求:
* 把用户输入的三个数先转换成整数形式,分别存储给不同的变量。
* 求出这三个变量的和,并打印。
例1:
输入:1 2 3
输出:6
解释:1 + 2 + 3 = 6
例2:
输入:6 7 8
输出:21
解释:6 + 7 + 8 = 21
| a = int(input())
b = int(input())
c = int(input())
print(a+b+c) | 161,728 | complete | a = int(input())
b = int(input())
c = int(input())
print(a+b+c)
# print('a + b + c','=',a+b+c) | 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:"3173";s:10:"questionid";s:4:"6215";s:8:"testtype";s:1:"0";s:8... | 677,229 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
14,082 | 440 | 循环2.3 | 388 | 补全以下代码,使其打印0到5的所有值。
| for i in range(0, 10):
print(i)
if (i == 5):
break | 36,597 | 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:"... | 172,415 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
45,685 | 2,107 | 列表LAB1 | 542 | 写一个函数replace_element_in_list(),传入三个参数:input_list (string格式的整数列表), num_from (int), num_to (int),
将input_list中所有的num_from换成num_to。
比如:
input_list = ['1','2','3','4','1','2','3','2']
num_from = 2
num_to = 10
执行完毕后,input_list = ['1','10','3','4','1','10','3','10']
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果,直接更改原列表并返回。
| input_list = input().split(',')
num_1 = int(input())
num_2 = int(input())
# 请不要更改此行以上的代码
def replace_element_in_list(input_list, num_from, num_to):
for i in range(0, len(input_list)):
if int(input_list[i]) == num_from:
input_list[i] = str(num_to)
return input_list
# 请不要更改此行以下的代码
print(repl... | 175,675 | todo | input_list = input().split(',')
num_1 = int(input())
num_2 = int(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def replace_element_in_list(input_list,num_from,num_to):
for i in input_list:
while str(i) == str(num_from):
str(i) == str(num_to)
return input_list
# 请不要更改此行以下的代码
print(replac... | 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:"555";s:10:"questionid";s:3:"542";s:8:"testtype";s:1:"0";s:8:"... | 731,901 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
46,118 | 2,181 | 输入和输出 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) | 178,199 | complete | num1 = int(input())
num2 = int(input())
print(num1 + num2) | 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... | 740,669 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
34,887 | 771 | 列表LAB2 | 543 | 编写一个count_numbers()函数,传入一个参数:input_list (string格式的个位整数),
在此函数中,新建一个10位长的列表,每一位代表input_list内含有此位数的个数,并返回这个列表。
例1:
input_list = ['1', '0', '7', '7', '8', '3']
则返回 [1, 1, 0, 1, 0, 0, 0, 2, 1, 0]
input_list内含1个0,因此返回列表的第0位为1;
内含1个1,因此返回列表的第1位为1;
内含2个7,因此返回列表的第7位为2;
内含1个3,因此返回列表的第3位为1;
内含1个8,因此返回列表的第8位为1。
例2:
inp... | input_list = input().split(',')
# 请不要更改此行以上的代码
def count_numbers(input_list):
res = [0,0,0,0,0,0,0,0,0,0]
for i in input_list:
res[int(i)] += 1
return res
# 请不要更改此行以下的代码
print(count_numbers(input_list)) | 132,399 | todo | input_list = input().split(',')
# 请不要更改此行以上的代码
def count_numbers(input_list):
new_list(a,b,c,d,e,f,g,h,i,j,k)
a=0
b=0
c=0
d=0
e=0
f=0
g=0
h=0
i=0
j=0
k=0
for i in range(0,len(input_list)):
if(input_list[i]==0):
a++
if(inpu... | 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:82:" File "__tester__.python3", line 18
a++
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:6;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandb... | 571,509 | 2 | 0 | No error | No error | File "__tester__.python3", line 18
a++
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
26,116 | 840 | 变量和赋值 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) | 71,818 | 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... | 323,161 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
15,880 | 572 | 范围 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('睡觉了') | 42,632 | todo | time = (int)(input())
if 8<time<22:
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:104:" File "__tester__.python3", line 4
else:
^
SyntaxError: invalid character in identifier
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourceco... | 191,408 | 2 | 0 | No error | No error | File "__tester__.python3", line 4
else:
^
SyntaxError: invalid character in identifier
| SyntaxError | SyntaxError | SyntaxError | error |
22,785 | 673 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 63,028 | todo | param = int(input())
def print_num(param):
if (param==10):
return 10
| 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:2;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:"... | 275,873 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
18,361 | 28 | 递归2.2 | 608 | 设计一个函数palindrom(num), 打印以0为中心向两边展开num次,每次递增1的回文。
例如当num = 0, 输出 "0"
例1:
输入: 0
输出: "0"
解释: 输入是0, 不往两边展开.
例2:
输入: 1
输出: "1 0 1"
解释: 输入是1, 往两边展开1次.
例3:
输入: 2
输出: "2 1 0 1 2"
解释: 输入是2, 往两边展开2次.
| input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return "0"
else:
left = str(num) + " "
mid = palindrome(num - 1)
right = " " + str(num)
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int)) | 51,442 | complete | input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return 0
else:
left = str(num) + " "
mid = palindrome( num - 1 )
right = " " + str(num)
return left + str(mid) + right
# 请不要更改此行以下的代码
print(palindrome(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:"689";s:10:"questionid";s:3:"608";s:8:"testtype";s:1:"0";s:8:"... | 262,678 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
35,830 | 1,210 | 递归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)) | 140,035 | 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:"... | 589,652 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
8,831 | 182 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 20,282 | complete | print(" 你好\n再见 ") | 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:"2257";s:10:"questionid";s:4:"2929";s:8:"testtype";s:1:"0";s:8... | 98,682 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
47,532 | 2,204 | 加法 | 326 | 写一行代码,将 功德 (karma) 加一。
如:
karma = 5
则输出
6
| karma = int(input())
karma = karma + 1
print(karma) | 182,276 | 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:"... | 755,232 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
43,304 | 1,437 | 循环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) | 165,503 | todo | param = input()
x = 0
y = 0
def count_spaces_and_commas(param):
for i in param:
if i==',':
x+=1
print('有'+str(x)+'个逗号',end='')
for i in param:
if i==' ':
x+=1
print('和'+str(y)+'个空格')
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: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:"... | 692,178 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 14, in <module>
count_spaces_and_commas(param)
File "__tester__.python3", line 7, in count_spaces_and_commas
x+=1
UnboundLocalError: local variable 'x' referenced before assignment
" | UnboundLocalError | No error | No error | UnboundLocalError | UnboundLocalError | error |
4,902 | 24 | 递归LAB1 | 315 | 编写一个函数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)) | 7,574 | complete | 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 - 1) + fib_3(num - 2) + fib_3(num - 3) # ... | 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:6;s:10:"actualmark";d:6;s:11:"testresults";a:6:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"350";s:10:"questionid";s:3:"315";s:8:"testtype";s:1:"0";s:8:"... | 39,982 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
35,312 | 87 | 列表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)) | 137,810 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
def palindrome(my_list):
first = my_list.pop(0)
last = my_list.pop()
i = 0
while i <len(my_list):
if my_list[i] == my_list[len(my_list)-1-i]:
i+=1
else:
return (False)
break
... | 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:7;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:"... | 581,469 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
21,340 | 771 | 范围 3.7 | 3,284 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int,存入num_animals。
* 如果num_animals大于或等于30,给forest_size赋值为3。
* 否则,给forest_size赋值为1。
* 打印forest_size。
例1:
输入:30
输出:3
解释:30 = 30,所以size_forest被赋值为3。
例2:
输入:15
输出:1
解释:15不符合大于等于30的条件,所以size_forest被赋值为1。
| num_animals = int(input())
if num_animals >= 30:
forest_size = 3
else:
forest_size = 1
print(forest_size)
| 59,778 | complete | num_animals=int(input())
if num_animals>=30:
forest_size=3
else:
forest_size=1
print(forest_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:"2365";s:10:"questionid";s:4:"3284";s:8:"testtype";s:1:"0";s:8... | 295,919 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
3,833 | 20 | 字典LAB3 | 260 | 【(附加题)找出第一个重复的字符】
编写一个函数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 = inpu... | 6,723 | todo | input_str = input()
# 请不要更改此行以上的代码
position={}
res=''
pos=-1
def get_first_duplicate(input_str):
for i in input_str:
if res in position:
if position[i]<int(pos):
res=i
pos=position[i]
else:
return res
else:
... | 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:6;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"274";s:10:"questionid";s:3:"260";s:8:"testtype";s:1:"0";s:8:"... | 36,543 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 20, in <module>
print(get_first_duplicate(input_str))
File "__tester__.python3", line 8, in get_first_duplicate
if res in position:
UnboundLocalError: local variable 'res' referenced before assignment
" | UnboundLocalError | No error | No error | UnboundLocalError | UnboundLocalError | error |
34,422 | 1,196 | 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)) | 130,472 | 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<x and y<z:
print y
else:
print z
print(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:137:" File "__tester__.python3", line 7
print x
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(x)?
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:11... | 548,156 | 2 | 0 | No error | No error | File "__tester__.python3", line 7
print x
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(x)?
| SyntaxError | SyntaxError | SyntaxError | error |
32,569 | 1,094 | 输入和输出 1.13 | 2,931 | 按要求写出代码。
* 要求:
* 把用户输入的值打印出来。
* 最后有一个空行。
例1:
输入:3
输出:3
例2:
输入:hi
输出:hi
| result = input()
print(result) | 120,822 | complete | a = input();
print(a) | 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:"2263";s:10:"questionid";s:4:"2931";s:8:"testtype";s:1:"0";s:8... | 510,516 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
11,874 | 339 | 递归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) | 30,540 | 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:"... | 138,184 | 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 |
41,888 | 1,365 | 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) | 161,771 | 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:"... | 677,413 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
30,705 | 977 | 列表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)) | 106,457 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def palindrome(li):
li.pop()
del li[0]
for i in range(0,len(li)):
if li[0] != li[len[li] - 1]:
return False
return True
# 请不要更改此行以下的代码
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:"... | 453,229 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 14, in <module>
print(palindrome(temp_list))
File "__tester__.python3", line 9, in palindrome
if li[0] != li[len[li] - 1]:
TypeError: 'builtin_function_or_method' object is not subscriptable
" | TypeError | No error | No error | TypeError | TypeError | error |
14,227 | 460 | 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) | 37,238 | todo | print('I can')
print('swim.')
my_age = '10'
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... | 482,145 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
35,955 | 1,181 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 140,708 | todo | param = int(input())
def print_num(param):
if param == 10:
return param
print_num(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:3;s:10:"actualmark";d:2;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:"... | 593,713 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
6,222 | 255 | LAB1.1 | 343 | 补全以下代码,使其打印x被y整除三次,并打印每次的结果。
如:
x = 9
y = 2
则输出:
4
2
1
| x = int(input())
y = int(input())
x = x // y
print(x)
x = x // y
print(x)
x = x // y
print(x) | 11,979 | todo | x = int(input())
y = int(input())
# 在此处补全代码
for i in range(3):
i= x//y
print(i)
i=i//y | 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:"388";s:10:"questionid";s:3:"343";s:8:"testtype";s:1:"0";s:8:"... | 61,302 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
13,903 | 345 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 36,099 | todo | ptint(input( )+"岁"/n) | 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:"2273";s:10:"questionid";s:4:"2933";s:8:"testtype";s:1:"0";s:8... | 163,252 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 1, in <module>
ptint(input( )+"岁"/n)
NameError: name 'ptint' is not defined
" | NameError | No error | No error | NameError | NameError | error |
37,967 | 485 | 递归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)) | 148,401 | 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:"... | 618,399 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
37,766 | 1,252 | 递归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) | 148,111 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def days_left_to_sunday(day):
if 0 < 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:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:1;s:11:"testresults";a:3:{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:"... | 617,246 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
47,821 | 2,229 | 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)) | 182,861 | complete | 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)) | 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:"... | 758,616 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
7,263 | 244 | 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) | 13,990 | complete | x = int(input())
y = int(input())
# 在此处补全代码
print(x / y)
print(x / y / y)
print(x / y / y / 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: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:"... | 72,953 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
11,447 | 141 | 字典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]... | 29,263 | todo | 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_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:109:" File "__tester__.python3", line 11
else user_info[user_name]=1
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"s... | 149,023 | 2 | 0 | No error | No error | File "__tester__.python3", line 11
else user_info[user_name]=1
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
29,962 | 718 | 循环3.1 | 393 | 补全以下代码,打印输入字符串的第5位(有疑问请咨询小组长)。
例如:
输入:"CircleCat"
打印:"l"
| param = input()
print(param[4]) | 99,743 | todo | param = input()
print(param[4]) | 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:72:"Sorry: IndentationError: unexpected indent (__tester__.python3, line 2)
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandboxinfo";a:... | 433,213 | 2 | 0 | No error | No error | Sorry: IndentationError: unexpected indent (__tester__.python3, line 2)
| IndentationError | IndentationError | IndentationError | error |
13,389 | 348 | 字典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]
... | 34,784 | todo | input_str = input()
dict_1={}
list_2=[]
def get_first_duplicate(input_str):
for i in input_str:
if i in dict_1:
dict_1[i]+=1
else:
dict_1[i]=1
for j in dict_1.keys():
if dict_1[j]>=2:
list_2.append(j)
return list_2[0]
else:
print('')
print(get_first_duplicate(input_str)) | 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:"... | 180,597 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
34,895 | 1,196 | 递归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)) | 132,524 | complete | 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-3)+fib_3(num-2)+fib_3(num-1)# 在这里补充代码
# 请不要更改此行以下的代码
pri... | 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:6;s:10:"actualmark";d:6;s:11:"testresults";a:6:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"705";s:10:"questionid";s:3:"611";s:8:"testtype";s:1:"0";s:8:"... | 557,556 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
33,236 | 986 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 124,562 | todo | print(' 你好\n 再见') | 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:"2257";s:10:"questionid";s:4:"2929";s:8:"testtype";s:1:"0";s:8... | 529,488 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
24,902 | 791 | 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) | 68,274 | todo | print('I can')
print("swim")
my_age = 10
print('my age:',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... | 303,487 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
25,141 | 791 | 范围 3.7 | 3,284 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int,存入num_animals。
* 如果num_animals大于或等于30,给forest_size赋值为3。
* 否则,给forest_size赋值为1。
* 打印forest_size。
例1:
输入:30
输出:3
解释:30 = 30,所以size_forest被赋值为3。
例2:
输入:15
输出:1
解释:15不符合大于等于30的条件,所以size_forest被赋值为1。
| num_animals = int(input())
if num_animals >= 30:
forest_size = 3
else:
forest_size = 1
print(forest_size)
| 68,867 | complete | num_animals=int(input())
if num_animals>=30:
forest_size=3
else:
forest_size=1
print(forest_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:"2365";s:10:"questionid";s:4:"3284";s:8:"testtype";s:1:"0";s:8... | 307,054 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
38,962 | 1,285 | 判断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) | 151,971 | complete | convert_num = int(input())
if convert_num >= 10 :
convert_num = convert_num - 10
else :
convert_num = convert_num
print(convert_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:3:"418";s:10:"questionid";s:3:"368";s:8:"testtype";s:1:"0";s:8:"... | 633,480 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
30,832 | 1,020 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 107,942 | todo | print("00000\n","0 0 0\n","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... | 458,494 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
8,683 | 195 | 函数1.0 | 2,824 | 定义一个叫做 WELCOME_TO_CIRCLE_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() | 19,499 | todo | def welcome_to_circle_cat():
print("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: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:"2203";s:10:"questionid";s:4:"2824";s:8:"testtype";s:1:"0";s:8... | 96,924 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
46,370 | 2,227 | 判断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) | 179,105 | complete | param = int(input())
def convert_num(param):
if (param >= 10):
param=param-10
return param
else:
return param
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: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:"418";s:10:"questionid";s:3:"368";s:8:"testtype";s:1:"0";s:8:"... | 744,182 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
33,199 | 1,033 | 字典LAB2 | 6,290 | 【考勤计数器】
编写一个程序来记录考勤,包含两个函数:
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_in... | 124,451 | complete | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info={}
def log_user(user_name):
user_name = str(user_name)
if user_name in user_info:
user_info[user_name] = user_info[user_name]+1
else:
user_info[user_name] = 1
def print_user_log(user_name):
if user_nam... | 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:"3241";s:10:"questionid";s:4:"6290";s:8:"testtype";s:1:"0";s:8... | 532,537 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
15,692 | 572 | 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) | 42,090 | todo | print("I can")
print("swim")
my_age = 10
print('my age: '+(str)(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... | 190,068 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
29,142 | 536 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 91,078 | complete | param = int(input())
def print_num(param):
if (param == 10):
print(param)
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:"... | 397,950 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
22,563 | 617 | 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) | 62,476 | complete | x = int(input())
y = int(input())
x=x/y
print(x)
print(x/y)
print(x/y/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: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:"... | 273,007 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
30,639 | 985 | 输入和输出 1.10 | 2,925 | 按要求写出代码。
* 要求:
* 打印:"生日快乐!"(不打印引号)
| print("生日快乐!") | 106,184 | complete | 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:"2253";s:10:"questionid";s:4:"2925";s:8:"testtype";s:1:"0";s:8... | 452,490 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
46,690 | 2,271 | 输入和输出 1.11 | 2,928 | 按要求写出代码。
* 要求:
* 打印:
你好
我在吃饭
(注意最后有一个空行)
| print("你好")
print("我在吃饭") | 180,064 | 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... | 747,603 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
36,606 | 1,104 | 循环3.3 | 395 | 请逐位打印一个字符串。
如:
输入:CircleCat
输出
C
i
r
c
l
e
c
a
t
| param = input()
for i in param:
print(i) | 145,053 | todo | param = input()
for i in (0,len(param)):
print(param[i]) | 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:"447";s:10:"questionid";s:3:"395";s:8:"testtype";s:1:"0";s:8:"... | 604,107 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 3, in <module>
print(param[i])
IndexError: string index out of range
" | IndexError | No error | No error | IndexError | IndexError | error |
5,995 | 268 | 判断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)) | 11,609 | todo | param = int(input())
def get_discount():
if get_discount<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: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:"408";s:10:"questionid";s:3:"366";s:8:"testtype";s:1:"0";s:8:"... | 59,817 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 9, in <module>
print(get_discount(param))
TypeError: get_discount() takes 0 positional arguments but 1 was given
" | TypeError | No error | No error | TypeError | TypeError | error |
22,955 | 701 | 列表LAB2 | 543 | 编写一个count_numbers()函数,传入一个参数:input_list (string格式的个位整数),
在此函数中,新建一个10位长的列表,每一位代表input_list内含有此位数的个数,并返回这个列表。
例1:
input_list = ['1', '0', '7', '7', '8', '3']
则返回 [1, 1, 0, 1, 0, 0, 0, 2, 1, 0]
input_list内含1个0,因此返回列表的第0位为1;
内含1个1,因此返回列表的第1位为1;
内含2个7,因此返回列表的第7位为2;
内含1个3,因此返回列表的第3位为1;
内含1个8,因此返回列表的第8位为1。
例2:
inp... | input_list = input().split(',')
# 请不要更改此行以上的代码
def count_numbers(input_list):
res = [0,0,0,0,0,0,0,0,0,0]
for i in input_list:
res[int(i)] += 1
return res
# 请不要更改此行以下的代码
print(count_numbers(input_list)) | 63,256 | complete | input_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def count_numbers(input_list):
list = []
x = 0
count = 0
while (0 <=x < 10):
for i in input_list:
if x == i:
count += 1
list.append(count)
... | 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:6;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"559";s:10:"questionid";s:3:"543";s:8:"testtype";s:1:"0";s:8:"... | 281,217 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
21,224 | 757 | 判断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)) | 59,364 | complete | param = int(input())
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: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:"408";s:10:"questionid";s:3:"366";s:8:"testtype";s:1:"0";s:8:"... | 257,705 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
23,874 | 701 | 列表LAB0.3 | 549 | 请写一个函数create_matrix(),传入3个int参数r,c,val。
返回一个列表,列表内有r个列表,这r个列表中每个有c个val.
例1:
r = 1
c = 2
val = 3
返回 [[3,3]]
例2:
r = 2
c = 3
val = 0
返回 [[0, 0, 0], [0, 0, 0]]
请不要使用任何列表自带函数。
| input_int = int(input())
input_int_2 = int(input())
input_int_3 = int(input())
# 请不要更改此行以上的代码
def create_matrix(r, c, val):
return r *[c * [val]]
# 请不要更改此行以下的代码
print(create_matrix(input_int, input_int_2, input_int_3)) | 65,675 | complete | input_int = int(input())
input_int_2 = int(input())
input_int_3 = int(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def create_matrix(input_int, input_int_2, input_int_3):
res_list = []
my_list = [input_int_3] * input_int_2
for i in range(input_int):
res_list.append(my_list)
return res_list
# 请不要更改此行以下的代码
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:3:"599";s:10:"questionid";s:3:"549";s:8:"testtype";s:1:"0";s:8:"... | 288,389 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
31,329 | 1,062 | 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) | 112,343 | complete | print('I can')
print('swim.')
my_age = 10
print('my age:',my_age) | 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:"2279";s:10:"questionid";s:4:"2974";s:8:"testtype";s:1:"0";s:8... | 480,387 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
9,878 | 166 | 循环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) | 23,288 | todo | param = input()
# 在此处编写代码
def count_spaces_and_commas(param):
a = 0
b = 0
for i in str(param):
if i == ',':
a = a + 1
if i == ' ':
b = b + 1
print ("有",a,"个逗号和",b,"个空格", sep"")
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:160:" File "__tester__.python3", line 12
print ("有",a,"个逗号和",b,"个空格", sep"")
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:4;s:10:"actualmark";i... | 147,686 | 2 | 0 | No error | No error | File "__tester__.python3", line 12
print ("有",a,"个逗号和",b,"个空格", sep"")
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
24,855 | 771 | 循环2.3 | 391 | 请完成以下代码,使其打印
1
2
3
5
6
7
(跳过4)
| for i in range(1,8):
if (i == 4):
continue
print(i) | 68,216 | todo | for i in range(1,8):
while(i!=4):
print(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:81:"Sorry: IndentationError: expected an indented block (__tester__.python3, line 3)
";s:11:"maxpossmark";d:1;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandbo... | 315,022 | 2 | 0 | No error | No error | Sorry: IndentationError: expected an indented block (__tester__.python3, line 3)
| IndentationError | IndentationError | IndentationError | error |
21,433 | 774 | 分支 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) | 59,894 | complete | user_age = int(input())
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: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:"2425";s:10:"questionid";s:4:"3477";s:8:"testtype";s:1:"0";s:8... | 260,298 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
40,388 | 1,302 | 循环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) | 156,280 | todo | param = input()
count1=0
count2=0
def count_spaces_and_commas(param):
for i in param:
if(i==','):
count1 += 1
else:
continue
if(i==' '):
count2 += 1
else:
continue
print("有"+count1+"个逗号和"+count2+"个空格")
... | 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:"... | 656,827 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 20, in <module>
count_spaces_and_commas(param)
File "__tester__.python3", line 7, in count_spaces_and_commas
count1 += 1
UnboundLocalError: local variable 'count1' referenced before assignment
" | UnboundLocalError | No error | No error | UnboundLocalError | UnboundLocalError | error |
12,983 | 271 | 字典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]... | 33,486 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
user_info={}
count=0
def log_user(user_name):
for i in range (0, len(user_info)):
if user_name in user_info:
user_info[user_name]+=1
else:
user_info[user_name]=1
count+=1
... | 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:"... | 157,157 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 24, in <module>
print_user_log(i)
File "__tester__.python3", line 18, in print_user_log
print (user_info[user_name])
KeyError: 'Circle'
" | KeyError | No error | No error | KeyError | KeyError | error |
21,262 | 757 | 循环LAB1 | 397 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 59,424 | complete | param = input()
# 在此处编写代码
def reverse_string(param):
a=" "
for i in param:
a=i+a
return a
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:"... | 273,575 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
25,750 | 637 | 循环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,921 | todo | param = int(input())
# 在此处补全代码
def double_until_one_thousand(num):
while(num<1000):
print(num)
num=num*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: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:"2074";s:10:"questionid";s:4:"2432";s:8:"testtype";s:1:"0";s:8... | 315,035 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
22,543 | 719 | 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)) | 62,410 | complete | i = int(input())
def is_leap_year(year):
# 在这里补全代码
if ((i%4==0)and(i%100!=0)):
return"是闰年"
elif(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:"... | 272,868 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
29,032 | 410 | 递归2.2 | 608 | 设计一个函数palindrom(num), 打印以0为中心向两边展开num次,每次递增1的回文。
例如当num = 0, 输出 "0"
例1:
输入: 0
输出: "0"
解释: 输入是0, 不往两边展开.
例2:
输入: 1
输出: "1 0 1"
解释: 输入是1, 往两边展开1次.
例3:
输入: 2
输出: "2 1 0 1 2"
解释: 输入是2, 往两边展开2次.
| input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return "0"
else:
left = str(num) + " "
mid = palindrome(num - 1)
right = " " + str(num)
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int)) | 90,271 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return 1# 在这里补全代码
else:
left = num# 在这里补全代码
mid = palindrome(num-1) # 在这里补全代码 )
right = num# 在这里补全代码
return str(left) +' '+ str(mid) +' '+ str(right)
# 请不要更改此行以下的代码
print(palin... | 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:"689";s:10:"questionid";s:3:"608";s:8:"testtype";s:1:"0";s:8:"... | 394,408 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
17,022 | 608 | 函数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() | 45,755 | todo | # 在这里编写代码
def welcome_to_circle_cat():
print('Welcome to circle cat!')
print('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: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:"3190";s:10:"questionid";s:4:"6231";s:8:"testtype";s:1:"0";s:8... | 203,917 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
24,195 | 642 | 循环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) | 66,484 | todo | param = int(input())
# 在此处补全代码
def double_until_one_thousand(param):
print(param)
while parma<=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: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:"2074";s:10:"questionid";s:4:"2432";s:8:"testtype";s:1:"0";s:8... | 292,926 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 11, in <module>
double_until_one_thousand(param)
File "__tester__.python3", line 6, in double_until_one_thousand
while parma<=1000:
NameError: name 'parma' is not defined
" | NameError | No error | No error | NameError | NameError | error |
11,591 | 382 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 29,562 | todo | print("0000")
print("0 0 0")
peint("0000") | 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... | 135,011 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 3, in <module>
peint("0000")
NameError: name 'peint' is not defined
" | NameError | No error | No error | NameError | NameError | error |
13,551 | 143 | 变量和赋值 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) | 35,107 | 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... | 160,380 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
7,602 | 138 | 循环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) | 15,356 | complete | param = input()
def count_spaces_and_commas(param):
a = b = 0
for i in param:
if i == " ":
a += 1
elif i == ",":
b += 1
print('有{}个逗号和{}个空格'.format(b,a))
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:"... | 84,116 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
37,752 | 932 | 判断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) | 148,051 | complete | param = int(input())
def convert_num(input_num):
if (input_num >= 10):
input_num = input_num - 10
print(input_num)
else:
print(input_num)
convert_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: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:"418";s:10:"questionid";s:3:"368";s:8:"testtype";s:1:"0";s:8:"... | 615,872 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
290 | 35 | 加法 | 30 | 写一行代码,将 功德 (karma) 加一。
如:
karma = 5
则输出
6
| karma = int(input())
karma = karma + 1
print(karma) | 395 | complete | karma = int(input())
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:2:"15";s:10:"questionid";s:2:"30";s:8:"testtype";s:1:"0";s:8:"te... | 1,604 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
37,800 | 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,166 | todo | i = int(input())
def is_leap_year(i):
if ((i%4==0)and(i%400==0)):
return("是闰年")
elif(i%100!=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:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:3;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:"... | 616,961 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
16,872 | 538 | 输入和输出 1.11 | 2,928 | 按要求写出代码。
* 要求:
* 打印:
你好
我在吃饭
(注意最后有一个空行)
| print("你好")
print("我在吃饭") | 45,175 | 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... | 201,986 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
39,057 | 425 | LAB1.1 | 343 | 补全以下代码,使其打印x被y整除三次,并打印每次的结果。
如:
x = 9
y = 2
则输出:
4
2
1
| x = int(input())
y = int(input())
x = x // y
print(x)
x = x // y
print(x)
x = x // y
print(x) | 152,364 | complete | x = int(input())
y = int(input())
a=int(x/y)
b=int(a/y)
c=int(b/y)
print(a)
print(b)
print(c)
# 在此处补全代码 | 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:2;s:10:"actualmark";d:2;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"388";s:10:"questionid";s:3:"343";s:8:"testtype";s:1:"0";s:8:"... | 635,995 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
44,304 | 2,004 | 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)) | 169,857 | complete | 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)) | 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:"... | 709,989 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
2,866 | 44 | 字典1.2 | 241 | 请定义两个字典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]) | 5,146 | todo | test_param = input()
score_dict {'john':'90', 'jane:':'100', 'james':'0'}
status_dict {'john':'active', 'jane:':'active', 'james':'inactive'}
print(my_dict[test_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:139:" File "__tester__.python3", line 2
score_dict {'john':'90', 'jane:':'100', 'james':'0'}
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:... | 25,112 | 2 | 0 | No error | No error | File "__tester__.python3", line 2
score_dict {'john':'90', 'jane:':'100', 'james':'0'}
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
34,546 | 1,196 | 判断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) | 130,803 | todo | param = int(input())
def convert_num(input_num):
if (input_num >= 10):
input_num = input_num - 10
else:
print(input_num)
convert_num(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:"418";s:10:"questionid";s:3:"368";s:8:"testtype";s:1:"0";s:8:"... | 549,625 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
44,050 | 2,004 | 范围 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('睡觉了') | 169,029 | 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... | 707,650 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
33,315 | 1,127 | 输入和输出 1.11 | 2,928 | 按要求写出代码。
* 要求:
* 打印:
你好
我在吃饭
(注意最后有一个空行)
| print("你好")
print("我在吃饭") | 124,856 | 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... | 530,373 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
24,561 | 752 | 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) | 67,313 | complete | 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) | 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:2;s:10:"actualmark";d:2;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... | 297,238 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
19,577 | 724 | 硬币数 | 2,054 | 补全以下代码,将所有种类硬币的和打印出来。
注:题目中的yuan / jiao是硬币种类的拼音,没有其他含义。
| num_yuan = int(input())
num_jiao = int(input())
num_coins = num_yuan + num_jiao
print(num_coins) | 54,550 | complete | 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:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:2;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... | 238,992 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
38,474 | 1,285 | 输入和输出 1.13 | 2,931 | 按要求写出代码。
* 要求:
* 把用户输入的值打印出来。
* 最后有一个空行。
例1:
输入:3
输出:3
例2:
输入:hi
输出:hi
| result = input()
print(result) | 150,814 | todo | print(input) | 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... | 628,650 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
44,862 | 2,084 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 172,837 | complete | param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
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:"... | 719,858 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
5,873 | 79 | 加法 | 326 | 写一行代码,将 功德 (karma) 加一。
如:
karma = 5
则输出
6
| karma = int(input())
karma = karma + 1
print(karma) | 11,475 | complete | karma = int(input())
# 在这里填写代码
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:"... | 58,570 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
18,669 | 698 | 循环3.4 | 396 | 编写一个函数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)) | 52,214 | todo | param = int(input())
def count_ones( param):
count = 0
while param:
if param % 2 == 1:
count += 1
param //= 2
return param
# 在此处编写代码
count_ones(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:"451";s:10:"questionid";s:3:"396";s:8:"testtype";s:1:"0";s:8:"... | 238,503 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
35,078 | 898 | 列表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)) | 135,734 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def palindrome(my_list):
if len(my_list) <= 1:
return True
del my_list[-1]
del my_list[0]
if len(my_list) > 0:
last_element = int(my_list[-1])
first_element = int(my_list[0])
if first_element == last_e... | 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:82:" File "__tester__.python3", line 18
else:
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:8;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandb... | 584,967 | 2 | 0 | No error | No error | File "__tester__.python3", line 18
else:
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
45,708 | 2,126 | 范围 3.7 | 3,281 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int,存入num_students。
* 如果num_students小于50,打印'没到齐';
* 否则,打印'到齐了'。
例1:
输入:30
输出:没到齐
解释:30 < 50
例2:
输入:50
输出:到齐了
解释:50不符合小于50的条件。
| num_students = int(input())
if num_students < 50:
print('没到齐')
else:
print('到齐了')
| 175,745 | complete | num_students = int(input())
if num_students < 50:
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:"2350";s:10:"questionid";s:4:"3281";s:8:"testtype";s:1:"0";s:8... | 731,424 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
4,656 | 49 | 递归2.2 | 312 | 设计一个函数palindrom(num), 打印以0为中心向两边展开num次,每次递增1的回文。
例如当num = 0, 输出 "0"
例1:
输入: 0
输出: "0"
解释: 输入是0, 不往两边展开.
例2:
输入: 1
输出: "1 0 1"
解释: 输入是1, 往两边展开1次.
例3:
输入: 2
输出: "2 1 0 1 2"
解释: 输入是2, 往两边展开2次.
| input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return "0"
else:
left = str(num) + " "
mid = palindrome(num - 1)
right = " " + str(num)
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int)) | 7,370 | todo | input_int = int(input())
def palindrome(num):
if num == 0:
return 0
else:
left = num
mid = palindrome(num-1)
right = num
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int)) | 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:3:"334";s:10:"questionid";s:3:"312";s:8:"testtype";s:1:"0";s:8:"... | 39,295 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
17,065 | 498 | 变量和赋值 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) | 45,977 | complete | num_cats=int(input())
num_dogs=int(input())
print(num_cats + num_dogs,"\n ") | 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... | 241,982 | 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.