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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,897 | 45 | 列表3.1 | 239 | 请编写一个函数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)) | 5,283 | complete | temp_list = input().split(',')
def get_max(temp_list):
for i in range(0,len(temp_list)) :
return (max(temp_list))
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:"178";s:10:"questionid";s:3:"239";s:8:"testtype";s:1:"0";s:8:"... | 26,687 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
12,945 | 444 | 范围 3.14 | 3,369 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int,存入cat_age。
* 如果cat_age大于或等于1,并且小于或等于10,打印'可以上飞机';
* 否则,打印'不能上飞机'。
例1:
输入:3
输出:可以上飞机
解释:1 < 3 < 10,所以打印'可以上飞机'。
例2:
输入:12
输出:不能上飞机
解释:12 > 10,所以打印'不能上飞机'。
| cat_age = int(input())
if (1 <= cat_age <= 10):
print('可以上飞机')
else:
print('不能上飞机') | 33,469 | complete | cat_age=int(input())
if 1<=cat_age<=10:
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:"2390";s:10:"questionid";s:4:"3369";s:8:"testtype";s:1:"0";s:8... | 152,410 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
46,479 | 2,227 | 字典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]
... | 179,218 | complete | input_str = input()
# 请不要更改此行以上的代码
# 在这里编写代码
def get_first_duplicate(input_str):
position={}
res=""
pos=len(input_str)
for index,char in enumerate(input_str):
if char in position:
if position[char]<pos:
res=char
pos=position[char]
... | 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:"... | 744,816 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
14,946 | 427 | 列表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)) | 38,892 | todo | line_list = input().split(';')
temp_list = []
for i in line_list:
temp_list.append(i.split(','))
# 请不要更改此行以上的代码
def sum_of_matrix(my_list):
for i in range(0,len(m)):
for j in range(0,len(n)):
print(my_list[m][n])
# 在这里编写代码
# 请不要更改此行以下的代码
print(sum_of_matrix(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:"534";s:10:"questionid";s:3:"501";s:8:"testtype";s:1:"0";s:8:"... | 189,488 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 14, in <module>
print(sum_of_matrix(temp_list))
File "__tester__.python3", line 7, in sum_of_matrix
for i in range(0,len(m)):
NameError: name 'm' is not defined
" | NameError | No error | No error | NameError | NameError | error |
18,347 | 698 | 范围 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('到齐了')
| 51,225 | todo | num_students = int(input())
if num_students<50:
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:120:" File "__tester__.python3", line 6
print("到齐了")
^
SyntaxError: invalid character in identifier
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"... | 228,360 | 2 | 0 | No error | No error | File "__tester__.python3", line 6
print("到齐了")
^
SyntaxError: invalid character in identifier
| SyntaxError | SyntaxError | SyntaxError | error |
37,725 | 1,252 | 字典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]) | 148,023 | 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... | 615,732 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
6,055 | 79 | 递归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)) | 11,677 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def power_of_two(num):
if num == 0:
# 在此补充
return 1
else:
2 ** power_of_two(num)
# 请不要更改此行以下的代码
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:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:1;s:11:"testresults";a:2:{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:"... | 59,665 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 12, in <module>
print(power_of_two(input_int))
File "__tester__.python3", line 9, in power_of_two
2 ** power_of_two(num)
File "__tester__.python3", line 9, in power_of_two
2 ** power_of_two(num)
File "__tester__.python3",... | RecursionError | No error | No error | RecursionError | RecursionError | error |
30,997 | 1,026 | 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)) | 109,318 | complete | i = int(input())
def is_leap_year(year):
if (year/400-int(year/400)) == 0 or (year/4-int(year/4)) == 0 and (year/100-int(year/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: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:"... | 464,764 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
4,157 | 50 | 字典LAB2 | 258 | 【考勤计数器】
编写一个程序来记录考勤,包含一个函数:
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... | 6,852 | 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 user_log(user_name):
value=user_info[user_name]
return value
# 请不要更改... | 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:"266";s:10:"questionid";s:3:"258";s:8:"testtype";s:1:"0";s:8:"... | 36,916 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 19, in <module>
print_user_log(i)
NameError: name 'print_user_log' is not defined
" | NameError | No error | No error | NameError | NameError | error |
3,468 | 15 | 列表LAB0.3 | 250 | 请写一个函数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)) | 6,073 | todo | input_int = int(input())
input_int_2 = int(input())
input_int_3 = int(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def create_matrix(r,c,val):
original_list = [val]
my_list=[ ]
temp_list=[ ]
for i in range(0,c):
my_list = my_list+original_list
for j in range(0,r):
temp_list += my_... | 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:"233";s:10:"questionid";s:3:"250";s:8:"testtype";s:1:"0";s:8:"... | 31,437 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
17,172 | 572 | 列表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... | 46,243 | complete | 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
# 请... | 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:"555";s:10:"questionid";s:3:"542";s:8:"testtype";s:1:"0";s:8:"... | 208,357 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
23,672 | 450 | 递归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)) | 65,390 | 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:"... | 286,158 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
19,521 | 730 | 循环LAB1 | 397 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 54,261 | todo | param = input()
# 在此处编写代码
def reverse_string(param):
s=''
t=len(param)
for i in range(1,t):
s=s+param[t-i]
return 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:4;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;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:"... | 238,033 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
28,819 | 692 | 字典LAB0.1 | 550 | 定义一个字典num_to_word,把0-10的数字(int)转换为汉字(str)。
例1:
print(num_to_word[7])
应输出
七
例2:
print(num_to_word[10])
应输出
十
| input_int = int(input())
# 请不要更改此行以上的代码
num_to_word = {1:"一", 2:"二", 3:"三", 4:"四", 5:"五", 6:"六", 7:"七", 8:"八", 9:"九", 10:"十"}
# 请不要更改此行以下的代码
print(num_to_word[input_int]) | 85,413 | complete | input_int = int(input())
# 请不要更改此行以上的代码
num_to_word={0:'零',1:'一',2:'二',3:'三',4:'四',5:'五',6:'六',7:'七',8:'八',9:'九',10:'十'}
# 请不要更改此行以下的代码
print(num_to_word[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:"604";s:10:"questionid";s:3:"550";s:8:"testtype";s:1:"0";s:8:"... | 382,301 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
14,482 | 341 | 字典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) | 37,825 | todo | input_dict = input()
my_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
my_dict={}
key=[1,3,5,7]
for i in key:
my_dict.pop(key)
# 请不要更改此行以下的代码
print(my_dict) | 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:"609";s:10:"questionid";s:3:"551";s:8:"testtype";s:1:"0";s:8:"... | 173,552 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 9, in <module>
my_dict.pop(key)
KeyError: [1, 3, 5, 7]
" | KeyError | No error | No error | KeyError | KeyError | error |
11,806 | 254 | 成员&标识 | 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('猜错了') | 30,225 | todo | 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: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:"2395";s:10:"questionid";s:4:"3418";s:8:"testtype";s:1:"0";s:8... | 183,645 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 3, in <module>
if my_guess in my-list:
NameError: name 'my' is not defined
" | NameError | No error | No error | NameError | NameError | error |
24,908 | 324 | 递归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)) | 68,290 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return '0' # 在这里补全代码
else:
left = str(num) # 在这里补全代码
mid = palindrome(num-1) # 在这里补全代码 )
right = str(num) # 在这里补全代码
# 请不要更改此行以下的代码
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:"689";s:10:"questionid";s:3:"608";s:8:"testtype";s:1:"0";s:8:"... | 307,460 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
39,305 | 1,289 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 153,210 | todo | print(input(''\n)+"岁")
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:161:" File "__tester__.python3", line 1
print(input(''\n)+"岁")
^
SyntaxError: unexpected character after line continuation character
";s:11:"maxpossmark";d:5;s:10... | 638,746 | 2 | 0 | No error | No error | File "__tester__.python3", line 1
print(input(''\n)+"岁")
^
SyntaxError: unexpected character after line continuation character
| SyntaxError | SyntaxError | SyntaxError | error |
31,254 | 933 | 判断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)) | 112,109 | todo | param = int(input())
# 在此处补全代码
def get_discount():
if param < 140:
ticket_price = 0
else:
ticket_price = 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:"... | 472,687 | 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 |
7,016 | 280 | 循环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) | 13,217 | todo | param = input()
# 在此处编写代码
def count_spaces_and_commas(param):
count1 = 0
count2 = 0
for i in str(param):
if i == "," and i == " ":
count1 = count1 + 1
count2 = count2 + 1
print("有" + str(count1) + "个逗号和" + str(count2) + "个空格")
count_spaces_and_commas(p... | 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:4;s:10:"actualmark";d:0;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:"... | 128,088 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
36,084 | 1,233 | 输入和输出 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) | 141,119 | complete | 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: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... | 594,722 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
36,450 | 812 | 块&缩进 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('蜘蛛很少') | 144,330 | todo | 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: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 9)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandbo... | 602,145 | 2 | 0 | No error | No error | Sorry: IndentationError: expected an indented block (__tester__.python3, line 9)
| IndentationError | IndentationError | IndentationError | error |
30,154 | 776 | 列表2.2 | 470 | 用循环,pop()和append()将my_list反转过来存进new_list。
| my_list = input().split(',')
new_list = []
# 请不要更改此行以上的代码
for i in range(0, len(my_list)):
new_list.append(my_list.pop())
# 请不要更改此行以下的代码
print(",".join(new_list)) | 101,571 | complete | my_list = input().split(',')
new_list = []
# 请不要更改此行以上的代码
# 在这里编写代码
while my_list:
new_list.append(my_list.pop())
# 请不要更改此行以下的代码
print(",".join(new_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:"484";s:10:"questionid";s:3:"470";s:8:"testtype";s:1:"0";s:8:"... | 434,973 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
12,032 | 264 | 列表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)) | 31,081 | complete | import ast
input_list = ast.literal_eval(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def get_min_plus_max(lis):
max = lis[0]
min = lis[0]
for i in lis:
max = max if max>i else i
min = min if min<i else i
return max + min
# 请不要更改此行以下的代码
print(get_min_plus_max(input_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: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:"... | 140,304 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
7,108 | 259 | 列表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)) | 13,281 | todo | line_list = input().split(';')
temp_list = []
for i in line_list:
temp_list.append(i.split(','))
# 请不要更改此行以上的代码
del sum_of_matrix(my_list):
result = 0
for i in range(0, len(my_list)):
for j in range(0, len(my_list[j])):
result += int(my_list[i][j])
return result
# 请不要更... | 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:129:" File "__tester__.python3", line 7
del sum_of_matrix(my_list):
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"testre... | 134,813 | 2 | 0 | No error | No error | File "__tester__.python3", line 7
del sum_of_matrix(my_list):
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
36,395 | 473 | 判断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) | 144,140 | complete | param = int(input())
def convert_num(input_num):
if (input_num >= 10):
input_num = input_num - 10
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:"... | 602,669 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
28,490 | 414 | 分支 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) | 83,925 | todo | num_spiders = int( input(""))
web_size = 1
if num_spiders == 10:
web_size = web_size*2
print(num_spiders)
print(web_size)
else:
web_size = web_size*3
num_spiders = num_spiders+5
print(num_spiders)
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:"2315";s:10:"questionid";s:4:"3126";s:8:"testtype";s:1:"0";s:8... | 631,694 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
14,083 | 440 | 循环2.3 | 391 | 请完成以下代码,使其打印
1
2
3
5
6
7
(跳过4)
| for i in range(1,8):
if (i == 4):
continue
print(i) | 36,598 | complete | for i in range(1,8):
if i == 4:
continue
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: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:"434";s:10:"questionid";s:3:"391";s:8:"testtype";s:1:"0";s:8:"... | 172,425 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
20,676 | 553 | 列表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)) | 58,297 | todo | input_list = input().split(',')
# 请不要更改此行以上的代码
def count_numbers(input_list):
newlist = [0,0,0,0,0,0,0,0,0,0]
for i in input_list:
newlist(int[i]) += 1
return newlist
# 在这里编写代码
# 请不要更改此行以下的代码
print(count_numbers(input_list)) | 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:112:" File "__tester__.python3", line 6
newlist(int[i]) += 1
^
SyntaxError: cannot assign to function call
";s:11:"maxpossmark";d:6;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14... | 268,152 | 2 | 0 | No error | No error | File "__tester__.python3", line 6
newlist(int[i]) += 1
^
SyntaxError: cannot assign to function call
| SyntaxError | SyntaxError | SyntaxError | error |
47,443 | 2,251 | 循环3.3 | 395 | 请逐位打印一个字符串。
如:
输入:CircleCat
输出
C
i
r
c
l
e
c
a
t
| param = input()
for i in param:
print(i) | 182,201 | 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:"... | 754,834 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,695 | 461 | 分支 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) | 35,636 | 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: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:"2425";s:10:"questionid";s:4:"3477";s:8:"testtype";s:1:"0";s:8... | 161,270 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
8,009 | 138 | 字典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]... | 16,530 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
uset_info={}
def log_user(user_name):
for k,v in uset_info.items():
if user_name in user_info:
user_name.v+=1
else:
uset_info.update(k=user_name,v=1)
# 请不要更改此行以下的代码
for i in input_dict... | 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:"... | 164,723 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 18, in <module>
print_user_log(i)
NameError: name 'print_user_log' is not defined
" | NameError | No error | No error | NameError | NameError | error |
35,102 | 970 | 列表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)) | 136,352 | 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):
a =[input_int_3] * input_int_2
b = ([a]) * input_int
return b
# 请不要更改此行以下的代码
print(create_matrix(input_int, input_int_2, input_int_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: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:"... | 574,078 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
10,945 | 375 | 函数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() | 27,184 | todo | 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: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... | 131,077 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
2,057 | 10 | 循环LAB4 | 99 | 请编写一个函数is_palindrome,判断输入的字符串是否是回文(什么是回文?)
例如:
输入:CircleCat
返回:False
输入: TAT
返回:True
输入:A
返回:True
| param = input()
def is_palindrome(s):
return s == s[::-1]
print(is_palindrome(param)) | 2,931 | complete | param = input()
back = param[::-1]
def is_palindrome(param):
if back == param:
print("True")
else:
print("False")
is_palindrome(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: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:"111";s:10:"questionid";s:2:"99";s:8:"testtype";s:1:"0";s:8:"t... | 16,489 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
43,255 | 1,425 | 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)) | 165,443 | 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:"... | 691,713 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
33,033 | 970 | 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) | 123,463 | complete | x = int(input())
y = int(input())
# 在此处补全代码
num1 = x//y
print(num1)
num2 = num1//y
print(num2)
num3 = num2//y
print(num3) | 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:"... | 526,229 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
18,297 | 608 | 循环LAB1 | 397 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 50,843 | complete | param = input()
# 在此处编写代码
def reverse_string(param):
param = param[::-1]
for i in param:
print(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:"... | 225,582 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
302 | 10 | LAB1.2 | 48 | 运动中消耗的卡路里是以下几项的和 减去75.4991 乘以时间 再除以 8.368:
年龄的0.2757倍 体重的0.03295倍 心率的1.0781倍
补全下列代码,给定了年龄,体重,心率,时间,计算出卡路里的消耗量
| 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) | 420 | 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:2:"35";s:10:"questionid";s:2:"48";s:8:"testtype";s:1:"0";s:8:"te... | 1,599 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
22,892 | 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)) | 63,254 | todo | 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):
list_1 = [input_int_3] * input_int_2
list_2 = []
for i in range(0, (input_int+1)):
list_2.append(list_1)
return list_2
... | 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:"599";s:10:"questionid";s:3:"549";s:8:"testtype";s:1:"0";s:8:"... | 280,300 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
47,362 | 2,291 | 列表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)) | 181,833 | 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):
if input_int <=0:
return None
result = []
for _ in range(input_int):
row =[]
for _ in range(input_int_2):
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: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:"... | 753,726 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
33,741 | 1,119 | 循环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)) | 126,145 | todo | param = int(input())
def count_ones(param):
count=0
for i in str(param):
if i=="1":
count+=1
print(count)
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: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:"... | 535,288 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
12,786 | 271 | 列表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)) | 33,287 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def count_negative(temp_list):
k=0
for int(i) in temp_list:
if i<0:
k=k+1
return k
# 请不要更改此行以下的代码
print(count_negative(temp_list)) | 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:120:" File "__tester__.python3", line 7
for int(i) in temp_list:
^
SyntaxError: cannot assign to function call
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:... | 150,707 | 2 | 0 | No error | No error | File "__tester__.python3", line 7
for int(i) in temp_list:
^
SyntaxError: cannot assign to function call
| SyntaxError | SyntaxError | SyntaxError | error |
44,513 | 2,047 | 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)) | 172,099 | complete | 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)
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: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:"395";s:10:"questionid";s:3:"346";s:8:"testtype";s:1:"0";s:8:"... | 716,859 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,478 | 429 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 34,914 | 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... | 158,547 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
46,133 | 1,057 | 范围 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('不好看')
| 178,255 | 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... | 742,082 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
41,947 | 1,365 | 循环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) | 162,019 | todo | param = int(input())
# 在此处补全代码
def double_until_one_thousand(param):
while param < 501:
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: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... | 678,103 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
6,079 | 79 | 列表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)) | 11,722 | complete | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def count_negative(my_list):
count_num = 0
for i in range(0, len(my_list)):
if int(my_list[i]) < 0:
count_num += 1
return count_num
# 请不要更改此行以下的代码
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: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:"501";s:10:"questionid";s:3:"474";s:8:"testtype";s:1:"0";s:8:"... | 60,115 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
16,921 | 423 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 45,492 | 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:"2257";s:10:"questionid";s:4:"2929";s:8:"testtype";s:1:"0";s:8... | 202,826 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
8,533 | 348 | 输入和输出 1.2 | 2,860 | 打印字符串:
I am Python!
| print("I am Python!") | 18,996 | 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... | 94,142 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
45,676 | 2,107 | 列表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)) | 175,673 | todo | import ast
input_list = ast.literal_eval(input())
input_int = int(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def multiply_lists(my_list,int_factor):
my_list = int_factor * my_list
return my_list
# 请不要更改此行以下的代码
print(multiply_lists(input_list, 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:162:" File "__tester__.python3", line 7
def multiply_lists(my_list,int_factor):
^
SyntaxError: invalid character ',' (U+FF0C)
";s:11:"maxpossmark";d:5;s:10:"a... | 731,868 | 2 | 0 | No error | No error | File "__tester__.python3", line 7
def multiply_lists(my_list,int_factor):
^
SyntaxError: invalid character ',' (U+FF0C)
| SyntaxError | SyntaxError | SyntaxError | error |
20,075 | 718 | 分支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) | 56,412 | todo | 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:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:83:" File "__tester__.python3", line 4
else
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sand... | 286,449 | 2 | 0 | No error | No error | File "__tester__.python3", line 4
else
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
33,846 | 1,119 | 循环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)) | 126,237 | complete | param = int(input())
def count_ones(param):
x=0
for i in str(param):
if i==1:
x+=1
print(x)
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: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:"... | 535,524 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
360 | 24 | Lab2.1 | 50 | 定义一个叫做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)) | 573 | todo | x = int(input())
y = int(input())
z = int(input())
# 在这里补全代码
def smallest_among_three(a, b, c):
if (a < b < c) or (a < c < b):
print(a)
elif (b < a < c) or (b < c < a):
print(b)
else:
print(c)
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:2:"40";s:10:"questionid";s:2:"50";s:8:"testtype";s:1:"0";s:8:"te... | 2,406 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
20,742 | 774 | 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) | 58,409 | 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... | 253,769 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
21,183 | 755 | 分支 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,230 | todo | 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: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:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandboxinfo";a:... | 257,282 | 2 | 0 | No error | No error | Sorry: IndentationError: unexpected indent (__tester__.python3, line 2)
| IndentationError | IndentationError | IndentationError | error |
237 | 31 | LAB1.1 | 47 | 补全以下代码,使其打印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) | 371 | complete | x = int(input())
y = int(input())
# 在此处补全代码
first_result = x//y
second_result = x//y**2
third_result = x//y**3
print(first_result)
print(second_result)
print(third_result) | 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:2:"33";s:10:"questionid";s:2:"47";s:8:"testtype";s:1:"0";s:8:"te... | 1,808 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
15,803 | 477 | 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) | 42,418 | todo | x = int(input())
y = int(input())
x=x/y
x=x/y
x=x/y | 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:"385";s:10:"questionid";s:3:"342";s:8:"testtype";s:1:"0";s:8:"... | 190,787 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
43,315 | 1,394 | 循环3.1 | 393 | 补全以下代码,打印输入字符串的第5位(有疑问请咨询小组长)。
例如:
输入:"CircleCat"
打印:"l"
| param = input()
print(param[4]) | 165,578 | todo | param = input()
print(param[:4])
# 在此处补全代码 | 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:4;s:10:"actualmark";d:0;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"439";s:10:"questionid";s:3:"393";s:8:"testtype";s:1:"0";s:8:"... | 692,415 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
27,204 | 731 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 76,621 | 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... | 340,742 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
35,269 | 1,211 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 137,391 | 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... | 577,906 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
32,877 | 1,098 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 122,402 | 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:"2257";s:10:"questionid";s:4:"2929";s:8:"testtype";s:1:"0";s:8... | 573,021 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
16,765 | 448 | 递归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)) | 44,861 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def power_of_two(num):
if num == 0:
return 1
else:
return power_of_two(pow(2,num))
# 请不要更改此行以下的代码
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:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:1;s:11:"testresults";a:2:{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:"... | 200,130 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
4,410 | 87 | 递归2.3 | 287 | 用递归编写一个函数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)) | 7,092 | todo | 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
# 在此补充
return x_power_of_y(x,(y-1))*y
# 请不要更改此行以下的代码
print(x_power_of_y(input_x, input_... | 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:90:" File "__tester__.python3", line 11
if y==0
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:1... | 36,200 | 2 | 0 | No error | No error | File "__tester__.python3", line 11
if y==0
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
9,216 | 138 | 范围 3.14 | 3,369 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int,存入cat_age。
* 如果cat_age大于或等于1,并且小于或等于10,打印'可以上飞机';
* 否则,打印'不能上飞机'。
例1:
输入:3
输出:可以上飞机
解释:1 < 3 < 10,所以打印'可以上飞机'。
例2:
输入:12
输出:不能上飞机
解释:12 > 10,所以打印'不能上飞机'。
| cat_age = int(input())
if (1 <= cat_age <= 10):
print('可以上飞机')
else:
print('不能上飞机') | 21,630 | complete | cat_age = int(input())
if 10>=cat_age >= 1:
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:"2390";s:10:"questionid";s:4:"3369";s:8:"testtype";s:1:"0";s:8... | 103,224 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
19,169 | 730 | 分支 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) | 53,205 | 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+=5
print(str(num_spiders)+" "+str(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... | 233,470 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
25,081 | 765 | 递归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)) | 68,765 | 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:"... | 316,277 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
8,022 | 226 | 循环3.1 | 393 | 补全以下代码,打印输入字符串的第5位(有疑问请咨询小组长)。
例如:
输入:"CircleCat"
打印:"l"
| param = input()
print(param[4]) | 16,706 | todo | param = input()
param = "CircleCat"
print(param[4]) | 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:4;s:10:"actualmark";d:1;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"439";s:10:"questionid";s:3:"393";s:8:"testtype";s:1:"0";s:8:"... | 86,180 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
27,671 | 604 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 80,418 | todo | param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
else:
print(print_num) | 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 5
else:
^
SyntaxError: invalid character in identifier
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourceco... | 604,657 | 2 | 0 | No error | No error | File "__tester__.python3", line 5
else:
^
SyntaxError: invalid character in identifier
| SyntaxError | SyntaxError | SyntaxError | error |
15,219 | 348 | 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)) | 39,642 | complete | i = int(input())
def is_leap_year(year):
import calendar
check_i=calendar.isleap(i)
if check_i==True:
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:"... | 178,982 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
11,542 | 195 | 列表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... | 29,514 | todo | input_list = input().split(',')
num_1 = int(input())#2
num_2 = int(input())#10
# 请不要更改此行以上的代码
def replace_element_in_list(input_list,num_1,num_2):
str1=input_list
before='num_1'
after='num_2'
table=''.maketrans(before,after)
return str1.translate(table)
# 请不要更改此行以下的代码
print(replace_el... | 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:"... | 237,218 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 14, in <module>
print(replace_element_in_list(input_list, num_1, num_2))
File "__tester__.python3", line 11, in replace_element_in_list
return str1.translate(table)
AttributeError: 'list' object has no attribute 'translate'
" | AttributeError | No error | No error | AttributeError | AttributeError | error |
37,497 | 1,266 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 147,621 | complete | print(input(),"岁")
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:"2273";s:10:"questionid";s:4:"2933";s:8:"testtype";s:1:"0";s:8... | 613,979 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
46,530 | 2,179 | 分支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) | 179,478 | complete |
def user_input():
num_spiders=int(input())
if(num_spiders!=15):
web_size=20
else:
web_size=num_spiders
web_size=web_size*2
return web_size
print(user_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: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:... | 745,770 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
5,485 | 196 | 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)) | 10,249 | todo | i = int(input())
def is_leap_year(year):
# 在这里补全代码
if year % 4 == 0 and year %100 != 0
return "是闰年"
elif year % 400 ==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:145:" File "__tester__.python3", line 5
if year % 4 == 0 and year %100 != 0
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";... | 53,348 | 2 | 0 | No error | No error | File "__tester__.python3", line 5
if year % 4 == 0 and year %100 != 0
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
9,310 | 342 | 成员&标识 | 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('猜错了') | 21,857 | 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... | 104,744 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
7,480 | 312 | 循环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)) | 14,758 | todo | param = int(input())
# 在此处编写代码
def count_ones(num):
one = 0
for i in range(0,len(num)):
if num[i] == 1:
one = one + 1
return one
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:3:"451";s:10:"questionid";s:3:"396";s:8:"testtype";s:1:"0";s:8:"... | 75,662 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 11, in <module>
print(count_ones(param))
File "__tester__.python3", line 6, in count_ones
for i in range(0,len(num)):
TypeError: object of type 'int' has no len()
" | TypeError | No error | No error | TypeError | TypeError | error |
23,746 | 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())
min=x
# 在这里补全代码
def smallest_among_three(x,y,z):
if (x>y):
if (y<z):
min=y
print(min)
else:
min=z
print(min)
print(min)
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:117:" File "__tester__.python3", line 10
print(min)
^
SyntaxError: invalid character in identifier
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:1... | 287,634 | 2 | 0 | No error | No error | File "__tester__.python3", line 10
print(min)
^
SyntaxError: invalid character in identifier
| SyntaxError | SyntaxError | SyntaxError | error |
42,891 | 1,394 | 输入和输出 1.11 | 2,928 | 按要求写出代码。
* 要求:
* 打印:
你好
我在吃饭
(注意最后有一个空行)
| print("你好")
print("我在吃饭") | 164,019 | todo | print('你好'/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:164:" File "__tester__.python3", line 1
print('你好'/n'我在吃饭')
^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
";s:11:"maxpossmark";d:1;s:10:"actua... | 686,553 | 2 | 0 | No error | No error | File "__tester__.python3", line 1
print('你好'/n'我在吃饭')
^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?
| SyntaxError | SyntaxError | SyntaxError | error |
26,553 | 650 | 递归2.3 | 609 | 设计一个函数palindrom(x, y), 打印以0为中心向两边展开x次,每次递增y的回文。
例1:
输入: 0 1
输出: "0"
解释: x是0, 不往两边展开.
例2:
输入: 1 3
输出: "3 0 3"
解释: x是1, 往两边展开1次, y是3, 每次增加3.
例3:
输入: 2 5
输出: "10 5 0 5 10"
解释: x是2, 往两边展开2次, y是5, 每次增加5.
| input_int_0 = int(input())
input_int_1 = int(input())
# 请不要更改此行以上的代码
def palindrome(x, y):
if x == 0:
return "0"
else:
left = str(x * y) + " "
mid = palindrome(x - 1, y)
right = " " + str(x * y)
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int_0,... | 73,808 | complete | input_int_0 = int(input())
input_int_1 = int(input())
# 请不要更改此行以上的代码
def palindrome(x, y):
if x==0:
return '0'
else:
left= str(y*x)
mid=' '+str(palindrome((x-1),y))+' '
right= left
return left+mid+right
# 在这里补全代码
# 请不要更改此行以下的代码
print(palindrome(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: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:"694";s:10:"questionid";s:3:"609";s:8:"testtype";s:1:"0";s:8:"... | 329,320 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
18,882 | 410 | 判断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)) | 52,571 | complete | param = int(input())
def get_discount(x):
if x<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:"... | 230,511 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
8,881 | 304 | 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) | 20,414 | 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: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";... | 98,766 | 2 | 0 | No error | No error | File "__tester__.python3", line 1
print('I can")
^
SyntaxError: EOL while scanning string literal
| SyntaxError | SyntaxError | SyntaxError | error |
44,167 | 1,450 | 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)) | 169,271 | todo | x = int(input())
y = int(input())
z = int(input())
def smallest_among_three():
if (x<y<=z):
return x
elif (y<x<=z):
return y
elif (z<x<=y):
return 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: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:"395";s:10:"questionid";s:3:"346";s:8:"testtype";s:1:"0";s:8:"... | 711,920 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 13, in <module>
print(smallest_among_three(x, y, z))
TypeError: smallest_among_three() takes 0 positional arguments but 3 were given
" | TypeError | No error | No error | TypeError | TypeError | error |
41,527 | 1,350 | 范围 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('到齐了')
| 160,634 | todo | num_students=int(input())
if num_students<50:
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:83:" File "__tester__.python3", line 4
else:
^^^^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sand... | 674,077 | 2 | 0 | No error | No error | File "__tester__.python3", line 4
else:
^^^^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
6,088 | 268 | 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)) | 11,756 | todo | x = int(input())
y = int(input())
z = int(input())
# 在这里补全代码
def smallest_among_three(x,y,z):
if x<y and x<z:
return x
if y<x and y<z:
return y
if z<x and z<y:
return z
print(smallest_among_three()) | 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:"395";s:10:"questionid";s:3:"346";s:8:"testtype";s:1:"0";s:8:"... | 60,334 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 16, in <module>
print(smallest_among_three())
TypeError: smallest_among_three() missing 3 required positional arguments: 'x', 'y', and 'z'
" | TypeError | No error | No error | TypeError | TypeError | error |
43,626 | 917 | 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)) | 166,652 | 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)
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:"... | 697,104 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
10,378 | 195 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 25,351 | todo | print_num = int(input())
if (print_num = 10):
print(10) | 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 3
if (print_num = 10):
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"... | 118,686 | 2 | 0 | No error | No error | File "__tester__.python3", line 3
if (print_num = 10):
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
3,550 | 23 | 列表LAB3 | 245 | 请写一个函数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
... | 6,179 | 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):
list_3 = []
for i in input_list_1:
for j in i:
new_value= input_list_1[i][j] + input_list_2[i][j]
list_3.append(new_valu... | 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:"199";s:10:"questionid";s:3:"245";s:8:"testtype";s:1:"0";s:8:"... | 30,613 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 15, in <module>
print(add_matrix(input_list_1, input_list_2))
File "__tester__.python3", line 9, in add_matrix
new_value= input_list_1[i][j] + input_list_2[i][j]
TypeError: list indices must be integers or slices, not list
" | TypeError | No error | No error | TypeError | TypeError | error |
6,451 | 254 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 12,311 | todo | age = int(input())
age = int(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: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:"... | 62,637 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
27,230 | 499 | 递归2.3 | 609 | 设计一个函数palindrom(x, y), 打印以0为中心向两边展开x次,每次递增y的回文。
例1:
输入: 0 1
输出: "0"
解释: x是0, 不往两边展开.
例2:
输入: 1 3
输出: "3 0 3"
解释: x是1, 往两边展开1次, y是3, 每次增加3.
例3:
输入: 2 5
输出: "10 5 0 5 10"
解释: x是2, 往两边展开2次, y是5, 每次增加5.
| input_int_0 = int(input())
input_int_1 = int(input())
# 请不要更改此行以上的代码
def palindrome(x, y):
if x == 0:
return "0"
else:
left = str(x * y) + " "
mid = palindrome(x - 1, y)
right = " " + str(x * y)
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int_0,... | 76,832 | complete | input_int_0 = int(input())
input_int_1 = int(input())
# 请不要更改此行以上的代码
def palindrome(x, y):
if x==0 :
return '0 '
else:
left=str(y*x)+' '
mid=palindrome(x-1, y)
right=str(y*x)+' '
return left+mid+right
# 在这里补全代码
# 请不要更改此行以下的代码
print(palindrome(input_in... | 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:"694";s:10:"questionid";s:3:"609";s:8:"testtype";s:1:"0";s:8:"... | 348,745 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
39,698 | 279 | 硬币数 | 2,054 | 补全以下代码,将所有种类硬币的和打印出来。
注:题目中的yuan / jiao是硬币种类的拼音,没有其他含义。
| num_yuan = int(input())
num_jiao = int(input())
num_coins = num_yuan + num_jiao
print(num_coins) | 154,176 | 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... | 643,717 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
34,071 | 1,134 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 128,309 | todo | print(end=' ',end=' ','你好',end=' ',end=' ',end=' ','\n再见\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:172:" File "__tester__.python3", line 1
print(end=' ',end=' ','你好',end=' ',end=' ',end=' ','\n再见\n')
^
SyntaxError: keyword argument repeated
";s:11:"maxpossmark";d:1... | 540,949 | 2 | 0 | No error | No error | File "__tester__.python3", line 1
print(end=' ',end=' ','你好',end=' ',end=' ',end=' ','\n再见\n')
^
SyntaxError: keyword argument repeated
| SyntaxError | SyntaxError | SyntaxError | error |
26,582 | 637 | 递归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)) | 74,014 | 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)
# 请不要更改此行以下的代码
print(fib_3(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: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:"... | 330,712 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
29,803 | 910 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 97,136 | 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... | 420,082 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
46,739 | 2,264 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 180,289 | 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:"... | 748,097 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
30,973 | 1,026 | 判断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)) | 109,314 | todo | param = int(input())
def get_age_status(param):
return
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: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:"413";s:10:"questionid";s:3:"367";s:8:"testtype";s:1:"0";s:8:"... | 464,588 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
41,831 | 989 | 列表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)) | 161,656 | complete | import ast
input_list = ast.literal_eval(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def get_min_plus_max(input_list):
max=input_list[0]
min=input_list[0]
for i in input_list:
if i>max:
max=i
for k in input_list:
if k<min:
min=k
return max+min
... | 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:"... | 676,794 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
27,093 | 692 | 列表2.2 | 470 | 用循环,pop()和append()将my_list反转过来存进new_list。
| my_list = input().split(',')
new_list = []
# 请不要更改此行以上的代码
for i in range(0, len(my_list)):
new_list.append(my_list.pop())
# 请不要更改此行以下的代码
print(",".join(new_list)) | 75,907 | complete | my_list = input().split(',')
new_list = []
# 请不要更改此行以上的代码
for i in range(len(my_list)):
new_list.append(my_list.pop())
# 请不要更改此行以下的代码
print(",".join(new_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:"484";s:10:"questionid";s:3:"470";s:8:"testtype";s:1:"0";s:8:"... | 346,035 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
44,856 | 2,084 | 判断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) | 172,836 | todo | param = int(input())
def convert_num(input_num):
if (input_num >= 10):
input_num = input_num - 10
return 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: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:"... | 719,846 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
9,975 | 196 | 分支 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) | 23,645 | todo | 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: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:"2315";s:10:"questionid";s:4:"3126";s:8:"testtype";s:1:"0";s:8... | 110,787 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
20,967 | 701 | 范围 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)
| 58,878 | 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... | 255,963 | 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.