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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,401 | 195 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 18,167 | 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... | 92,610 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
48,349 | 2,142 | 列表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)) | 184,388 | 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):
temp_list=[]
for x in range(0, input_int_2) :
temp_list[i]=input_int_3
temp_list_1=[]
for y in range(0, 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:0;s:11:"testresults";a:1:{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:"... | 766,149 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 17, in <module>
print(create_matrix(input_int, input_int_2, input_int_3))
File "__tester__.python3", line 10, in create_matrix
temp_list[i]=input_int_3
NameError: name 'i' is not defined. Did you mean: 'id'?
" | NameError | No error | No error | NameError | NameError | error |
40,096 | 1,218 | 循环2.3 | 391 | 请完成以下代码,使其打印
1
2
3
5
6
7
(跳过4)
| for i in range(1,8):
if (i == 4):
continue
print(i) | 155,224 | todo | for i in range(1,8):
if i == 4
break
# 在此处补全代码
print(i) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:93:" File "__tester__.python3", line 2
if i == 4
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:1;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;... | 648,880 | 2 | 0 | No error | No error | File "__tester__.python3", line 2
if i == 4
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
3,069 | 27 | 列表3.2 | 238 | 请编写一个函数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)) | 5,539 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
my_list = str(int())
def count_negative(my_list):
if (my_list < 0):
return count(my_list)
# 请不要更改此行以下的代码
print(count_negative(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"173";s:10:"questionid";s:3:"238";s:8:"testtype";s:1:"0";s:8:"... | 26,611 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 10, in <module>
print(count_negative(temp_list))
File "__tester__.python3", line 6, in count_negative
if (my_list < 0):
TypeError: '<' not supported between instances of 'list' and 'int'
" | TypeError | No error | No error | TypeError | TypeError | error |
48,288 | 2,142 | 判断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)) | 184,276 | complete | param = int(input())
# 在此补全代码
def get_age_status(param):
if 0<param<18:
return "未成年人"
elif 18<=param<65:
return "工作中"
elif param>=65:
return "退休了"
print(get_age_status(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"413";s:10:"questionid";s:3:"367";s:8:"testtype";s:1:"0";s:8:"... | 765,332 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
29,324 | 818 | 列表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)) | 92,593 | todo | line_list = input().split(';')
temp_list = []
for i in line_list:
temp_list.append(i.split(','))
# 请不要更改此行以上的代码
def sum_of_matrix(temp_list):
sumnum=0
for a in range(0,len(temp_list)):
for b in range(0,len(temp_list[i])):
sumnum+=int(temp_list[a][b])
return sumnum
# 请不... | 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:"... | 404,078 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 15, in <module>
print(sum_of_matrix(temp_list))
File "__tester__.python3", line 10, in sum_of_matrix
for b in range(0,len(temp_list[i])):
TypeError: list indices must be integers or slices, not str
" | TypeError | No error | No error | TypeError | TypeError | error |
14,332 | 341 | 列表3.1 | 472 | 请编写一个函数get_max(),传入一个列表参数my_list,其中的值都是格式为string的正整数,返回该列表里的最大数。
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果。
| temp_list = input().split(',')
# 请不要更改此行以上的代码
def get_max(my_list):
num_max = 0
for i in my_list:
num_max = max(int(i), num_max)
return num_max
# 请不要更改此行以下的代码
print(get_max(temp_list)) | 37,444 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
max_num=0
def get_max(temp_list):
for num in temp_list:
num=int(num)
if (num>max_num):
max_mun=num
return(max_num)
# 请不要更改此行以下的代码
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: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:"492";s:10:"questionid";s:3:"472";s:8:"testtype";s:1:"0";s:8:"... | 169,788 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
47,847 | 2,262 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 182,899 | todo | age = int(input())
print('my age is ',end=' ')
print(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:"... | 758,887 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
6,125 | 268 | 循环3.2 | 394 | 打印出输入字符串的长度。
如:
输入:CircleCat
打印:9
| param = input()
print(len(param)) | 11,772 | todo | param = input()
print(len(parma))
# 在此处补全代码 | 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:"443";s:10:"questionid";s:3:"394";s:8:"testtype";s:1:"0";s:8:"... | 61,006 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 2, in <module>
print(len(parma))
NameError: name 'parma' is not defined
" | NameError | No error | No error | NameError | NameError | error |
27,492 | 608 | 分支 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) | 78,668 | complete | num_spiders = int(input())
web_size = 1
if num_spiders == 10:
web_size *= 2
else:
web_size *= 3
num_spiders += 5
print(num_spiders, web_size) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2315";s:10:"questionid";s:4:"3126";s:8:"testtype";s:1:"0";s:8... | 349,392 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
11,349 | 393 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 28,828 | todo | print(" ",你好)
print("再见")
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: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... | 180,532 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 1, in <module>
print(" ",你好)
NameError: name '你好' is not defined
" | NameError | No error | No error | NameError | NameError | error |
44,650 | 2,084 | 硬币数 | 2,054 | 补全以下代码,将所有种类硬币的和打印出来。
注:题目中的yuan / jiao是硬币种类的拼音,没有其他含义。
| num_yuan = int(input())
num_jiao = int(input())
num_coins = num_yuan + num_jiao
print(num_coins) | 172,319 | 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... | 717,990 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
34,888 | 771 | 列表LAB2 | 543 | 编写一个count_numbers()函数,传入一个参数:input_list (string格式的个位整数),
在此函数中,新建一个10位长的列表,每一位代表input_list内含有此位数的个数,并返回这个列表。
例1:
input_list = ['1', '0', '7', '7', '8', '3']
则返回 [1, 1, 0, 1, 0, 0, 0, 2, 1, 0]
input_list内含1个0,因此返回列表的第0位为1;
内含1个1,因此返回列表的第1位为1;
内含2个7,因此返回列表的第7位为2;
内含1个3,因此返回列表的第3位为1;
内含1个8,因此返回列表的第8位为1。
例2:
inp... | input_list = input().split(',')
# 请不要更改此行以上的代码
def count_numbers(input_list):
res = [0,0,0,0,0,0,0,0,0,0]
for i in input_list:
res[int(i)] += 1
return res
# 请不要更改此行以下的代码
print(count_numbers(input_list)) | 132,399 | todo | input_list = input().split(',')
# 请不要更改此行以上的代码
def count_numbers(input_list):
new_list(a,b,c,d,e,f,g,h,i,j,k)
a=0
b=0
c=0
d=0
e=0
f=0
g=0
h=0
i=0
j=0
k=0
for i in range(0,len(input_list)):
if(input_list[i]==0):
a=a+1
if(in... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:6;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"559";s:10:"questionid";s:3:"543";s:8:"testtype";s:1:"0";s:8:"... | 571,516 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 41, in <module>
print(count_numbers(input_list))
File "__tester__.python3", line 4, in count_numbers
new_list(a,b,c,d,e,f,g,h,i,j,k)
NameError: name 'new_list' is not defined
" | NameError | No error | No error | NameError | NameError | error |
41,989 | 1,365 | 列表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)) | 162,047 | todo | my_list = input().split(',')
new_list = []
# 请不要更改此行以上的代码
# 在这里编写代码
for i in len(my_list):
if i != 0:
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: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:"484";s:10:"questionid";s:3:"470";s:8:"testtype";s:1:"0";s:8:"... | 678,284 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 6, in <module>
for i in len(my_list):
TypeError: 'int' object is not iterable
" | TypeError | No error | No error | TypeError | TypeError | error |
26,321 | 565 | 块&缩进 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('蜘蛛很少') | 72,600 | todo | num_spiders = int(input())
num_cats = int(input())
if 10<num_spiders<num_cats:
print("猫会吃掉蜘蛛")
elif (num_spiders>10)AND(num_cats<=num_spiders):
print("猫吃不完蜘蛛")
elif num_spiders<=10:
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:145:" File "__tester__.python3", line 5
elif (num_spiders>10)AND(num_cats<=num_spiders):
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";... | 330,759 | 2 | 0 | No error | No error | File "__tester__.python3", line 5
elif (num_spiders>10)AND(num_cats<=num_spiders):
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
37,873 | 932 | 循环LAB3 | 399 | 编写一个函数count_spaces_and_commas,打印出有几个空格和逗号。
例如:
输入: 你好,我的名字叫 逗猫师。
打印: 有1个逗号和1个空格
输入:我 你 她
打印:有0个逗号和2个空格
输入:,,,
打印:有3个逗号和0个空格
| param = input()
def count_spaces_and_commas(s):
num_spaces = 0
num_commas = 0
for i in s:
if i == " ":
num_spaces += 1
if i == ",":
num_commas += 1
print("有"+ str(num_commas) +"个逗号和" + str(num_spaces) + "个空格")
count_spaces_and_commas(param) | 148,311 | todo | param = input()
# 在此处编写代码
count_spaces_and_commas(param)
while i in param:
count = 0
comma = 0
if i ==",":
count = count +1
elif i == " "
comma = comma +1
print ("有"+count+"个逗号"+"和"+comma+"个空格") | 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:102:" File "__tester__.python3", line 11
elif i == " "
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourceco... | 618,169 | 2 | 0 | No error | No error | File "__tester__.python3", line 11
elif i == " "
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
47,235 | 2,291 | 循环LAB1 | 397 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 181,552 | complete | param = input()
# 在此处编写代码
def reverse_string(s):
return s[::-1]
print(reverse_string(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:4;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"456";s:10:"questionid";s:3:"397";s:8:"testtype";s:1:"0";s:8:"... | 752,792 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,130 | 178 | LAB2.2 | 348 | 补全以下代码,判断该年份是否是闰年。
如果是闰年,则打印“是闰年”;
否则,打印“不是闰年”。
| i = int(input())
def is_leap_year(year):
if ((year % 4 == 0 and year % 100 != 0) or year % 400 == 0):
return "是闰年"
else:
return "不是闰年"
print(is_leap_year(i)) | 33,969 | todo | i = int(input())
def is_leap_year(year):
# 在这里补全代码
if a % 400==0:
return'是闰年'
elif a % 400!=0:
if a % 4==0:
return'是闰年'
else:
return'不是闰年'
print(is_leap_year(i)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:81:"Sorry: IndentationError: expected an indented block (__tester__.python3, line 5)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandbo... | 160,793 | 2 | 0 | No error | No error | Sorry: IndentationError: expected an indented block (__tester__.python3, line 5)
| IndentationError | IndentationError | IndentationError | error |
30,698 | 977 | 列表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)) | 106,454 | complete | my_list = input().split(',')
new_list = []
# 请不要更改此行以上的代码
# 在这里编写代码
new_list = reversed(my_list)
# 请不要更改此行以下的代码
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:"... | 453,102 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
26,890 | 841 | 列表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)) | 75,278 | complete | temp_list = input().split(',')
# 请不要更改此行以上的代码
def count_negative(temp_list):
j=0
for i in temp_list:
i=int(i)
if (i<0):
j=j+1
else:
continue
print(str(j))
# 在这里编写代码
# 请不要更改此行以下的代码
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:"... | 348,440 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
48,276 | 2,337 | 输入和输出 1.2 | 2,860 | 打印字符串:
I am Python!
| print("I am Python!") | 184,220 | 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... | 765,166 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,166 | 304 | 字典LAB2 | 555 | 【考勤计数器】
编写一个程序来记录考勤,包含一个函数:
log_user(user_name) 不返回任何信息,记录user_name的一次到课
print_user_log(user_name) 不返回任何信息,打印user_name到课几次
如:
log_user("Circle")
log_user("Circle")
log_user("Cat")
log_user("Circle")
print_user_log("Circle")
print_user_log("Cat")
print_user_log("Flirter")
结果为:
3
1
0
如果没有思路请看下面提示
第̶一̶步̶:̶定̶义... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def log_user(user_name):
if user_name in user_info:
user_info[user_name] += 1
else:
user_info[user_name] = 1
def print_user_log(user_name):
if user_name in user_info:
print(user_info[user_name]... | 34,143 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
user_info = {}
def log_user(user_name):
user_info[user_name] = 0
if user_name in user_info:
user_info[user_name] = user_info[user_name] + 1
def print_user_log(user_name):
if user_name in user_info:
else:
... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:82:"Sorry: IndentationError: expected an indented block (__tester__.python3, line 14)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandb... | 176,011 | 2 | 0 | No error | No error | Sorry: IndentationError: expected an indented block (__tester__.python3, line 14)
| IndentationError | IndentationError | IndentationError | error |
46,208 | 2,154 | 判断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)) | 178,490 | todo | param = int(input())
def get_age_status(param):
if (param<18)and(param>0):
print("未成年人")
elif (param<65)and(param>=18):
print('工作中')
else:param>=65
print('退休了')
print(get_age_status(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:71:"Sorry: IndentationError: unexpected indent (__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:"sandboxinfo";a:2... | 741,971 | 2 | 0 | No error | No error | Sorry: IndentationError: unexpected indent (__tester__.python3, line 9) | IndentationError | IndentationError | IndentationError | error |
43,680 | 871 | 函数1.0 | 6,231 | 定义一个叫做 WELCOME_TO_CIRCLE_CAT() 的函数,它的内容是打印以下这句话
"Welcome to circle cat!"
并使用这个函数2次(不包含题目内的一次)。
| def welcome_to_circle_cat():
print("Welcome to circle cat!")
welcome_to_circle_cat()
welcome_to_circle_cat()
# 请不要更改此行以下的代码
welcome_to_circle_cat() | 167,337 | todo | # 在这里编写代码
def welcome_to_circle_cat()
print("Welcome to circle cat")
# 请不要更改此行以下的代码
welcome_to_circle_cat() | 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:127:" File "__tester__.python3", line 2
def welcome_to_circle_cat()
^
SyntaxError: expected ':'
";s:11:"maxpossmark";d:1;s:10:"actualmark";i:0;s:11:"testresu... | 699,907 | 2 | 0 | No error | No error | File "__tester__.python3", line 2
def welcome_to_circle_cat()
^
SyntaxError: expected ':'
| SyntaxError | SyntaxError | SyntaxError | error |
47,260 | 2,183 | 循环3.1 | 393 | 补全以下代码,打印输入字符串的第5位(有疑问请咨询小组长)。
例如:
输入:"CircleCat"
打印:"l"
| param = input()
print(param[4]) | 181,588 | complete | param = input()
# 在此处补全代码
count = 0
for i in param:
count += 1
if (count >= 5):
break
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:"439";s:10:"questionid";s:3:"393";s:8:"testtype";s:1:"0";s:8:"... | 754,538 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
39,792 | 932 | 字典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]
... | 154,269 | todo | input_str = input()
# 请不要更改此行以上的代码
#编写一个函数get_first_duplicate(input_str),
#用循环遍历input_string的每一位,
#则在position中添加一项key为该项,value为该项的index;
#如果存在,则将position字典中该字符对应的value跟pos比较,
#如果该value比较小,则将res替换成该字符,pos替换成postion
#内对应的value。cbaabc c:1,b:2,c:3
# 在这里编写代码
position = {}
pos = []
def get_first_duplica... | 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:7;s:10:"actualmark";d:2;s:11:"testresults";a:3:{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:"... | 644,993 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 28, in <module>
print(get_first_duplicate(input_str))
File "__tester__.python3", line 22, in get_first_duplicate
return void
NameError: name 'void' is not defined
" | NameError | No error | No error | NameError | NameError | error |
32,885 | 762 | 循环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) | 122,517 | todo | param = int(input())
def double_until_one_thousand(x)
while x<=1000:
print(x)
x*=2
double_until_one_thousand(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:139:" File "__tester__.python3", line 2
def double_until_one_thousand(x)
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:... | 519,896 | 2 | 0 | No error | No error | File "__tester__.python3", line 2
def double_until_one_thousand(x)
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
48,265 | 2,340 | 循环3.3 | 395 | 请逐位打印一个字符串。
如:
输入:CircleCat
输出
C
i
r
c
l
e
c
a
t
| param = input()
for i in param:
print(i) | 184,212 | complete | param = input()
for char in param:
print(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: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:"... | 765,035 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
10,413 | 196 | 列表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)) | 25,386 | todo | import ast
input_list = ast.literal_eval(input())
# 请不要更改此行以上的代码
def get_min_plus_max(input_list):
a = max(input_list)
b = min(input_list)
return a-b
# 在这里编写代码
# 请不要更改此行以下的代码
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:8;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:0;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:"... | 118,084 | 1 | 8 | No error | No error | No error | No error | No error | LogicError | error |
15,158 | 473 | 输入和输出 1.10 | 2,925 | 按要求写出代码。
* 要求:
* 打印:"生日快乐!"(不打印引号)
| print("生日快乐!") | 39,470 | todo | 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: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:"2253";s:10:"questionid";s:4:"2925";s:8:"testtype";s:1:"0";s:8... | 192,295 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
44,033 | 2,004 | 硬币数 | 2,054 | 补全以下代码,将所有种类硬币的和打印出来。
注:题目中的yuan / jiao是硬币种类的拼音,没有其他含义。
| num_yuan = int(input())
num_jiao = int(input())
num_coins = num_yuan + num_jiao
print(num_coins) | 168,948 | 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... | 706,708 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
41,924 | 1,365 | 判断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) | 161,963 | todo | input_num = int(input())
def convert_num(input_num):
if input_num >= 10:
input_num = input_num - 10
return input_num
else:
return input_num
print(convert_num(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"418";s:10:"questionid";s:3:"368";s:8:"testtype";s:1:"0";s:8:"... | 677,817 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 9, in <module>
print(convert_num(param))
NameError: name 'param' is not defined
" | NameError | No error | No error | NameError | NameError | error |
33,997 | 1,163 | 字典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]
... | 127,734 | complete | input_str = input()
# 请不要更改此行以上的代码
position = {}
res = ''
pos = int(len(input_str))
def get_first_duplicate(input_str):
global pos,res
for i in input_str:
if i not in position:
position[i] = input_str.index(i)
else:
if position[i] < pos:
res... | 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:"... | 541,981 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
32,698 | 1,087 | 循环2.3 | 391 | 请完成以下代码,使其打印
1
2
3
5
6
7
(跳过4)
| for i in range(1,8):
if (i == 4):
continue
print(i) | 121,645 | 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:"... | 515,854 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
32,336 | 1,067 | 字典LAB1 | 553 | 【用户名密码验证】
编写一个程序做到添加/验证用户名密码,包含两个函数:
add_user(user_name, pass_word) 不返回任何信息,用于添加一个用户,用户名是user_name,密码是pass_word
verify_user(user_name, pass_word)返回Boolean值(代表用户名密码是否正确),如果存在用户名为user_name,密码为pass_word的用户,则返回True,密码错误或者用户不存在则返回False
如:
add_user("circle", "cat")
print(verify_user("circle","cat"))
print(verify_user("... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
return False
# 请不要... | 119,825 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[str(user_name)]=str(pass_word)
# 在这里编写代码
def verify_user(user_name, pass_word):
if str(user_name) in user_info:
if user_info[str(user_name)] = str(pass_word):
... | 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:152:" File "__tester__.python3", line 10
if user_info[str(user_name)] = str(pass_word):
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:3;s:10:"actua... | 506,264 | 2 | 0 | No error | No error | File "__tester__.python3", line 10
if user_info[str(user_name)] = str(pass_word):
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
1,396 | 49 | 循环1.7 | 85 | 编写一个函数double_until_one_thousand, 将其打印出来后,乘二,直至其大于1000。
| param = int(input())
def double_until_one_thousand(num):
while(num <= 1000):
print(num)
num *= 2
double_until_one_thousand(param) | 2,024 | complete | param = int(input())
def double_until_one_thousand(param):
while param <=1000:
print(param)
param = param *2
double_until_one_thousand(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:2:"71";s:10:"questionid";s:2:"85";s:8:"testtype";s:1:"0";s:8:"te... | 9,210 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
42,590 | 1,387 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 163,032 | 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... | 682,888 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
17,030 | 485 | 范围 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('到齐了')
| 45,797 | complete | num_students=(int)(input())
if num_students<50:
print("没到齐")
else:
print("到齐了") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2350";s:10:"questionid";s:4:"3281";s:8:"testtype";s:1:"0";s:8... | 204,713 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
24,801 | 324 | 字典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]) | 68,036 | todo | test_param = input()
# 请不要更改此行以上的代码
# 在这里编写代码
score_dict = {john:90, jane:100, james:0}
status_dic = {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: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:4:"2525";s:10:"questionid";s:4:"3925";s:8:"testtype";s:1:"0";s:8... | 301,172 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 5, in <module>
score_dict = {john:90, jane:100, james:0}
NameError: name 'john' is not defined
" | NameError | No error | No error | NameError | NameError | error |
20,644 | 410 | 字典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]
... | 58,179 | todo | input_str = input()
# 请不要更改此行以上的代码
# 在这里编写代码
position={}
res=''
pos=int(len(input_str))
def get_first_duplicate(input_str):
for i in input_str:
if i in position:
if int(position[i])<int(pos):
res=i
pos=position[i]
else:position[i]=i
retu... | 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:7;s:10:"actualmark";d:0;s:11:"testresults";a:1:{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:"... | 255,168 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 17, in <module>
print(get_first_duplicate(input_str))
File "__tester__.python3", line 11, in get_first_duplicate
if int(position[i])<int(pos):
ValueError: invalid literal for int() with base 10: 'b'
" | ValueError | No error | No error | ValueError | ValueError | error |
39,986 | 1,153 | 递归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)) | 154,814 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def fib_3(num):
if num ==0 :
return 1 # 在这里补充代码
elif num == 1:
return 1# 在这里补充代码
elif num==3:
return 1
else:
return fib_3(num-3)+fib_3(num-2)+fib_3(num-1)# 在这里补充代码
# 请不要更改此行以下的代码
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:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:6;s:10:"actualmark";d:2;s:11:"testresults";a:3:{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:"... | 647,202 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 15, in <module>
print(fib_3(input_int))
File "__tester__.python3", line 12, in fib_3
return fib_3(num-3)+fib_3(num-2)+fib_3(num-1)# 在这里补充代码
File "__tester__.python3", line 12, in fib_3
return fib_3(num-3)+fib_3(num-2)+fib_3... | RecursionError | No error | No error | RecursionError | RecursionError | error |
35,722 | 1,181 | 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) | 139,735 | todo | x = int(input())
y = int(input())
one = x/y
two = one/y
three = two/y
print(one)
print(two)
print(three)
| 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:114:" File "__tester__.python3", line 7
print(one)
^
SyntaxError: invalid character in identifier
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14... | 588,544 | 2 | 0 | No error | No error | File "__tester__.python3", line 7
print(one)
^
SyntaxError: invalid character in identifier
| SyntaxError | SyntaxError | SyntaxError | error |
35,649 | 1,210 | 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) | 139,510 | complete | x = int(input())
y = int(input())
x = float(x/y)
print(x)
x = x/y
print(x)
x = x/y
print(x) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"385";s:10:"questionid";s:3:"342";s:8:"testtype";s:1:"0";s:8:"... | 586,872 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
31,522 | 1,033 | 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) | 114,889 | todo | x = int(input())
y = int(input())
# 在此处补全代码
one=x/y
twice=one/y
third=twice/y
print(one'\n'twice'\n'third'\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:117:" File "__tester__.python3", line 8
print(one'\n'twice'\n'third'\n')
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:11:"testresults";a:0:{... | 482,216 | 2 | 0 | No error | No error | File "__tester__.python3", line 8
print(one'\n'twice'\n'third'\n')
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
4,759 | 60 | 递归2.2 | 312 | 设计一个函数palindrom(num), 打印以0为中心向两边展开num次,每次递增1的回文。
例如当num = 0, 输出 "0"
例1:
输入: 0
输出: "0"
解释: 输入是0, 不往两边展开.
例2:
输入: 1
输出: "1 0 1"
解释: 输入是1, 往两边展开1次.
例3:
输入: 2
输出: "2 1 0 1 2"
解释: 输入是2, 往两边展开2次.
| input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return "0"
else:
left = str(num) + " "
mid = palindrome(num - 1)
right = " " + str(num)
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int)) | 7,473 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return str(num) # 在这里补全代码
else:
left = str(num)# 在这里补全代码
mid = palindrome(num-1) # 在这里补全代码 )
right = str(num)# 在这里补全代码
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:4;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:1;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"334";s:10:"questionid";s:3:"312";s:8:"testtype";s:1:"0";s:8:"... | 39,576 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
43,365 | 1,405 | 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)) | 165,668 | complete | x = int(input())
y = int(input())
z = int(input())
def smallest_among_three(x,y,z):
if x<y and x<z:
return x
elif y<x and y<z:
return y
elif z<x and z<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: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:"... | 693,157 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
22,096 | 480 | 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) | 61,392 | complete | x = int(input())
y = int(input())
a = x / y
print(a)
x = a
b = x / y
print(b)
x = b
c = x / y
print(c) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"385";s:10:"questionid";s:3:"342";s:8:"testtype";s:1:"0";s:8:"... | 268,246 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
11,985 | 427 | 输入和输出 1.11 | 2,928 | 按要求写出代码。
* 要求:
* 打印:
你好
我在吃饭
(注意最后有一个空行)
| print("你好")
print("我在吃饭") | 30,912 | complete | print("""你好
我在吃饭 """) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2256";s:10:"questionid";s:4:"2928";s:8:"testtype";s:1:"0";s:8... | 150,826 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
578 | 17 | 判断debug1 | 71 | 以下有一个函数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) | 758 | complete | param = int(input())
def convert_num(input_num):
if (input_num >= 10):
input_num = input_num - 10
print(input_num)
else:
print(input_num)
convert_num(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:2:"58";s:10:"questionid";s:2:"71";s:8:"testtype";s:1:"0";s:8:"te... | 3,132 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
38,914 | 1,291 | 列表LAB3 | 544 | 请写一个函数add_matrix(),传入两个二维列表参数matrix_1, matrix_2; 其中每个有n个长度为m的列表,其中都是int,返回一个二维列表,内容是前两个列表的和(对应的位置相加)。
例1:
输入
matrix_1 = [[7, 8],
[4, 1]]
matrix_2 = [[3, 7],
[4, 3]]
返回
[[10, 15],
[8, 4]]
例2:
输入
matrix_1 = [[0]]
matrix_2 = [[1]]
返回
[[1]]
例3:
输入
matrix_1 = [[1, 1, 1],
[2, 1... | import ast
input_list_1 = ast.literal_eval(input())
input_list_2 = ast.literal_eval(input())
# 请不要更改此行以上的代码
def add_matrix(matrix_1, matrix_2):
for i in range(0, len(matrix_1)):
for j in range(0, len(matrix_1[i])):
matrix_1[i][j] = matrix_1[i][j] + matrix_2[i][j]
return matrix_1
# 请不要更改此行以... | 151,801 | todo | import ast
input_list_1 = ast.literal_eval(input())
input_list_2 = ast.literal_eval(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def add_matrix(matrix1, matrix2):
res = matrix1
for i in range(matrix1):
for j in range(matrix1[0]):
res[i][j] = res[i][j] + matrix2[i][j]
j += 1
... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"565";s:10:"questionid";s:3:"544";s:8:"testtype";s:1:"0";s:8:"... | 632,839 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 16, in <module>
print(add_matrix(input_list_1, input_list_2))
File "__tester__.python3", line 9, in add_matrix
for i in range(matrix1):
TypeError: 'list' object cannot be interpreted as an integer
" | TypeError | No error | No error | TypeError | TypeError | error |
18,224 | 576 | 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) | 50,497 | 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... | 223,303 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
37,139 | 848 | 循环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)) | 146,547 | todo | param = int(input())
count = 0
# 在此处编写代码
def count_ones(param):
for i in param:
print(i)
a=print(i)
if (a == 1):
count += 1
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:"... | 611,014 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 10, in <module>
print(count_ones(param))
File "__tester__.python3", line 5, in count_ones
for i in param:
TypeError: 'int' object is not iterable
" | TypeError | No error | No error | TypeError | TypeError | error |
46,136 | 1,057 | 范围 3.9 | 3,293 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int,存入time。
* 如果time大于8且小于22,打印'醒着';
* 否则,打印'睡觉了'。
例1:
输入:8
输出:睡觉了
解释:8=8,8不符合大于8小于22的条件,所以打印'睡觉了'。
例2:
输入:12
输出:醒着
解释:12符合大于8小于22的条件,所以打印'醒着'。
| time = int(input())
if 8 < time < 22:
print('醒着')
else:
print('睡觉了') | 178,260 | complete | time = int(input())
if 8 < time < 22:
print('醒着')
else:
print('睡觉了') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2380";s:10:"questionid";s:4:"3293";s:8:"testtype";s:1:"0";s:8... | 742,107 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
6,590 | 275 | 判断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)) | 12,350 | todo | param = int(input())
# 在此补全代码
def get_age_status(param):
if (param >0 and param < 18):
print("未成年人")
elif(param >18 and param < 65):
print("工作中")
else:
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:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:4;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"413";s:10:"questionid";s:3:"367";s:8:"testtype";s:1:"0";s:8:"... | 62,839 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
26,268 | 565 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 72,220 | complete | 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: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:"377";s:10:"questionid";s:3:"339";s:8:"testtype";s:1:"0";s:8:"... | 321,512 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
29,893 | 411 | 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)) | 98,253 | complete | x = int(input())
y = int(input())
z = int(input())
def smallest_among_three(x,y,z):
if(x<=y<=z):
return x
elif(x<=z<=y):
return x
elif(y<=x<=z):
return y
elif(y<=z<=x):a
return y
else:
return z
print(smallest_among_three(x, y, z)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:73:"Sorry: IndentationError: unexpected indent (__tester__.python3, line 13)
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandboxinfo";a... | 427,008 | 2 | 0 | No error | No error | Sorry: IndentationError: unexpected indent (__tester__.python3, line 13)
| IndentationError | IndentationError | IndentationError | error |
6,692 | 203 | 循环2.3 | 391 | 请完成以下代码,使其打印
1
2
3
5
6
7
(跳过4)
| for i in range(1,8):
if (i == 4):
continue
print(i) | 12,527 | 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:"... | 114,713 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,094 | 384 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 33,863 | todo | print(end='',end=''.end='',end='',end='',end='',end='','你好')
print('再见')
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:163:" File "__tester__.python3", line 1
print(end='',end=''.end='',end='',end='',end='',end='','你好')
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:1;s:10... | 154,520 | 2 | 0 | No error | No error | File "__tester__.python3", line 1
print(end='',end=''.end='',end='',end='',end='',end='','你好')
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
12,711 | 448 | 输入和输出 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) | 33,033 | complete | num1=int(input())
num2=int(input())
result=num1+num2
print(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: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... | 149,818 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
25,677 | 590 | 循环3.1 | 393 | 补全以下代码,打印输入字符串的第5位(有疑问请咨询小组长)。
例如:
输入:"CircleCat"
打印:"l"
| param = input()
print(param[4]) | 70,662 | todo | param = input()
# 在此处补全代码
print(len(param)[5]) | 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:"439";s:10:"questionid";s:3:"393";s:8:"testtype";s:1:"0";s:8:"... | 314,060 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 4, in <module>
print(len(param)[5])
TypeError: 'int' object is not subscriptable
" | TypeError | No error | No error | TypeError | TypeError | error |
11,940 | 79 | 范围 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('不好看')
| 30,830 | 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... | 139,534 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
42,058 | 1,339 | 循环3.3 | 395 | 请逐位打印一个字符串。
如:
输入:CircleCat
输出
C
i
r
c
l
e
c
a
t
| param = input()
for i in param:
print(i) | 162,082 | complete | param = input()
for every_char in param:
print(every_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: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:"... | 680,412 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
30,918 | 776 | 字典LAB1 | 553 | 【用户名密码验证】
编写一个程序做到添加/验证用户名密码,包含两个函数:
add_user(user_name, pass_word) 不返回任何信息,用于添加一个用户,用户名是user_name,密码是pass_word
verify_user(user_name, pass_word)返回Boolean值(代表用户名密码是否正确),如果存在用户名为user_name,密码为pass_word的用户,则返回True,密码错误或者用户不存在则返回False
如:
add_user("circle", "cat")
print(verify_user("circle","cat"))
print(verify_user("... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
return False
# 请不要... | 109,055 | complete | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_db = {} # 存储用户名和密码的字典
def add_user(user_name, pass_word):
"""
添加一个用户,用户名为user_name,密码为pass_word
"""
user_db[user_name] = pass_word
def verify_user(user_name, pass_word):
"""
验证用户名和密码是否正确,如果正确则返回True,否则返回... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"616";s:10:"questionid";s:3:"553";s:8:"testtype";s:1:"0";s:8:"... | 462,956 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
46,386 | 2,229 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 179,112 | 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... | 744,279 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,231 | 418 | 输入和输出 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) | 34,445 | todo | # 获取用户输入的字符串,假设输入格式为 "3 4"
input_str = input()
# 使用 split() 方法分割字符串,得到一个列表
input_list = input_str.split()
# 将分割后的字符串列表中的每个元素转换为整数
num1 = int(input_list[0])
num2 = int(input_list[1])
# 打印两个整数的和
print(num1 + num2) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2410";s:10:"questionid";s:4:"3474";s:8:"testtype";s:1:"0";s:8... | 726,287 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 9, in <module>
num2 = int(input_list[1])
IndexError: list index out of range
" | IndexError | No error | No error | IndexError | IndexError | error |
33,911 | 1,138 | 分支 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) | 126,445 | todo | num_spiders=int(input())
web_size=1
if num_spiders==10:
web_size=2*web_size
else:
web_size=3*web_size
number_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: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:"2315";s:10:"questionid";s:4:"3126";s:8:"testtype";s:1:"0";s:8... | 536,416 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
10,794 | 178 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 26,546 | complete | age=input()
print(age,end=' ')
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... | 123,186 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
26,100 | 840 | 变量和赋值 3.5 | 3,018 | 按要求写出代码。
* 要求:
* 用户会输入两个数值,依次是猫的数量num_cats,一个是狗的数量num_dogs。
* 打印猫和狗总共的数量,并创建一个新的空行。
例1:
输入:1 2
输出:3
解释:1 + 2 = 3
例2:
输入:20 20
输出:40
解释:20 + 20 = 40
| total_animals = 0
num_cats = int(input())
num_dogs = int(input())
total_animals = num_cats + num_dogs
print(total_animals) | 71,818 | todo | num_cats=input()
num_dogs=input()
print('num_dogs'+'num_cats'\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:175:" File "__tester__.python3", line 3
print('num_dogs'+'num_cats'\n)
^
SyntaxError: unexpected character after line continuation character
";s:11:"maxpo... | 322,997 | 2 | 0 | No error | No error | File "__tester__.python3", line 3
print('num_dogs'+'num_cats'\n)
^
SyntaxError: unexpected character after line continuation character
| SyntaxError | SyntaxError | SyntaxError | error |
22,261 | 769 | 字典LAB1 | 553 | 【用户名密码验证】
编写一个程序做到添加/验证用户名密码,包含两个函数:
add_user(user_name, pass_word) 不返回任何信息,用于添加一个用户,用户名是user_name,密码是pass_word
verify_user(user_name, pass_word)返回Boolean值(代表用户名密码是否正确),如果存在用户名为user_name,密码为pass_word的用户,则返回True,密码错误或者用户不存在则返回False
如:
add_user("circle", "cat")
print(verify_user("circle","cat"))
print(verify_user("... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
return False
# 请不要... | 61,678 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info={}
def add_user(user_name, pass_word):
user_info['user_name']='pass_word'
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name]==pass_word:
return True
return... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:1;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"616";s:10:"questionid";s:3:"553";s:8:"testtype";s:1:"0";s:8:"... | 269,815 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
5,238 | 138 | 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)) | 8,827 | todo | x = int(input())
y = int(input())
z = int(input())
# 在这里补全代码
def smallest_among_three(x, y, z):
if x > y:
return y
else:
return x
if y > z:
return z
if x > z:
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:2;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:"... | 45,824 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
33,985 | 1,166 | 块&缩进 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('蜘蛛很少') | 127,485 | 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 4)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandbo... | 541,113 | 2 | 0 | No error | No error | Sorry: IndentationError: expected an indented block (__tester__.python3, line 4)
| IndentationError | IndentationError | IndentationError | error |
22,297 | 617 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 61,698 | todo | print(' 你好\n我在吃饭\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... | 269,695 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
26,608 | 791 | 列表LAB3 | 544 | 请写一个函数add_matrix(),传入两个二维列表参数matrix_1, matrix_2; 其中每个有n个长度为m的列表,其中都是int,返回一个二维列表,内容是前两个列表的和(对应的位置相加)。
例1:
输入
matrix_1 = [[7, 8],
[4, 1]]
matrix_2 = [[3, 7],
[4, 3]]
返回
[[10, 15],
[8, 4]]
例2:
输入
matrix_1 = [[0]]
matrix_2 = [[1]]
返回
[[1]]
例3:
输入
matrix_1 = [[1, 1, 1],
[2, 1... | import ast
input_list_1 = ast.literal_eval(input())
input_list_2 = ast.literal_eval(input())
# 请不要更改此行以上的代码
def add_matrix(matrix_1, matrix_2):
for i in range(0, len(matrix_1)):
for j in range(0, len(matrix_1[i])):
matrix_1[i][j] = matrix_1[i][j] + matrix_2[i][j]
return matrix_1
# 请不要更改此行以... | 74,024 | todo | import ast
input_list_1 = ast.literal_eval(input())
input_list_2 = ast.literal_eval(input())
# 请不要更改此行以上的代码
def add_matrix(input_list_1, input_list_2):
for i in range(len(input_list_1)):
for j in range(len(input_list_1)):
input_list_1=input_list_1[i][j]+input_list_2[i][j]
return inpu... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"565";s:10:"questionid";s:3:"544";s:8:"testtype";s:1:"0";s:8:"... | 329,755 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 13, in <module>
print(add_matrix(input_list_1, input_list_2))
File "__tester__.python3", line 8, in add_matrix
input_list_1=input_list_1[i][j]+input_list_2[i][j]
TypeError: 'int' object is not subscriptable
" | TypeError | No error | No error | TypeError | TypeError | error |
17,383 | 538 | 函数1.0 | 6,231 | 定义一个叫做 WELCOME_TO_CIRCLE_CAT() 的函数,它的内容是打印以下这句话
"Welcome to circle cat!"
并使用这个函数2次(不包含题目内的一次)。
| def welcome_to_circle_cat():
print("Welcome to circle cat!")
welcome_to_circle_cat()
welcome_to_circle_cat()
# 请不要更改此行以下的代码
welcome_to_circle_cat() | 47,031 | complete | # 在这里编写代码
def welcome_to_circle_cat() :
print("Welcome to circle cat!")
welcome_to_circle_cat()
welcome_to_circle_cat()
# 请不要更改此行以下的代码
welcome_to_circle_cat() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"3190";s:10:"questionid";s:4:"6231";s:8:"testtype";s:1:"0";s:8... | 209,025 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
20,939 | 153 | 递归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)) | 58,825 | complete | input_int = int(input())
# 请不要更改此行以上的代码
def power_of_two(num):
if num == 0:
return 1# 在此补充:
# 在此补充
else:
return 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: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:"... | 261,052 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
15,155 | 473 | 输入和输出 1.9 | 6,215 | 按要求写出代码。
* 要求:
* 把用户输入的三个数先转换成整数形式,分别存储给不同的变量。
* 求出这三个变量的和,并打印。
例1:
输入:1 2 3
输出:6
解释:1 + 2 + 3 = 6
例2:
输入:6 7 8
输出:21
解释:6 + 7 + 8 = 21
| a = int(input())
b = int(input())
c = int(input())
print(a+b+c) | 39,469 | complete | a=int(input())
b=int(input())
c=int(input())
print(a+b+c) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"3173";s:10:"questionid";s:4:"6215";s:8:"testtype";s:1:"0";s:8... | 192,290 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
4,216 | 64 | 字典LAB3 | 260 | 【(附加题)找出第一个重复的字符】
编写一个函数get_first_duplicate(input_str),找出一个String里第一次重复的字符:
例1:
输入: "abbcddeea"
输出: "a"
解释: a在第0位和最后一位, b在第1和第2位, d在第4和第5位, e在第6和第7位, 由于a是第一个出现并重复的字符, 因此返回a
例2:
输入: "abbcd"
输出: "b"
解释: b是唯一重复的, 因此返回b
例3:
输入: "abcd"
输出: ""
解释: 没有重复字符, 返回空字符
如果没有思路请看下面提示
此̶题̶的̶难̶点̶在̶于̶,̶不̶仅̶要̶找̶出̶重̶复̶的̶字̶符̶,̶还̶要... | input_str = input()
# 请不要更改此行以上的代码
def get_first_duplicate(input_str):
pos = len(input_str) + 1
res = ""
position = {}
for i in range(0, len(input_str)):
if input_str[i] in position:
if position[input_str[i]] < pos:
pos = i
res = inpu... | 6,868 | todo | input_str = input()
# 请不要更改此行以上的代码
duplicate_info={}
for i in input_str:
if i not in duplicate_info:
duplicate[i]=1
elif i in duplicate_info:
duplicate[i]+=1
for j in duplicate_info:
if j>1:
return duplicate_info[i]
# 在这里编写代码
# 请不要更改此行以下的代码
print(get_first_duplicate(... | 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 12
return duplicate_info[i]
^
SyntaxError: 'return' outside function
";s:11:"maxpossmark";d:6;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14... | 37,726 | 2 | 0 | No error | No error | File "__tester__.python3", line 12
return duplicate_info[i]
^
SyntaxError: 'return' outside function
| SyntaxError | SyntaxError | SyntaxError | error |
48,204 | 2,340 | 分支 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) | 184,075 | todo | def user_age():
if x == 18:
print("18")
else:
print("3") | 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... | 764,386 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
29,839 | 818 | 字典LAB2 | 6,290 | 【考勤计数器】
编写一个程序来记录考勤,包含两个函数:
log_user(user_name) 不返回任何信息,记录user_name的一次到课
print_user_log(user_name) 不返回任何信息,打印user_name到课几次
如:
log_user("Circle")
log_user("Circle")
log_user("Cat")
log_user("Circle")
print_user_log("Circle")
print_user_log("Cat")
print_user_log("Flirter")
结果为:
3
1
0
如果没有思路请看下面提示
第̶一̶步̶:̶定̶义... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def log_user(user_name):
if user_name in user_info:
user_info[user_name] += 1
else:
user_info[user_name] = 1
def print_user_log(user_name):
if user_name in user_info:
print(user_in... | 97,333 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
user_info={}
def log_user(user_name):
user_info[user_name]=1
for i in user_info:
if user_name in user_info:
user_info[user_name]+=1
# 请不要更改此行以下的代码
for i in input_dict['log']:
log_user(i)
for i in... | 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:"3241";s:10:"questionid";s:4:"6290";s:8:"testtype";s:1:"0";s:8... | 428,863 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 17, in <module>
print_user_log(i)
NameError: name 'print_user_log' is not defined
" | NameError | No error | No error | NameError | NameError | error |
11,444 | 141 | 字典LAB1 | 553 | 【用户名密码验证】
编写一个程序做到添加/验证用户名密码,包含两个函数:
add_user(user_name, pass_word) 不返回任何信息,用于添加一个用户,用户名是user_name,密码是pass_word
verify_user(user_name, pass_word)返回Boolean值(代表用户名密码是否正确),如果存在用户名为user_name,密码为pass_word的用户,则返回True,密码错误或者用户不存在则返回False
如:
add_user("circle", "cat")
print(verify_user("circle","cat"))
print(verify_user("... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
return False
# 请不要... | 29,262 | complete | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
user_info={}
def add_user(user_name, pass_word):
user_info[user_name]=pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name]==pass_word:
return True
return False
# 请不要... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"616";s:10:"questionid";s:3:"553";s:8:"testtype";s:1:"0";s:8:"... | 147,657 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
42,306 | 1,362 | 循环LAB4 | 400 | 请编写一个函数is_palindrome,判断输入的字符串是否是回文(什么是回文?)
例如:
输入:CircleCat
返回:False
输入: TAT
返回:True
输入:A
返回:True
| param = input()
def is_palindrome(s):
return s == s[::-1]
print(is_palindrome(param)) | 162,450 | todo | param = input()
def is_palindrome(string):
palindrome_string = string[::-1]
if palindrome_string == string:
print('Ture')
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:6;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:2;s:11:"testresults";a:8:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"468";s:10:"questionid";s:3:"400";s:8:"testtype";s:1:"0";s:8:"... | 681,038 | 1 | 6 | No error | No error | No error | No error | No error | LogicError | error |
9,519 | 166 | 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)) | 22,447 | todo | i = int(input())
def is_leap_year(year):
# 在这里补全代码
if (year%4 == 0 and year%100 != 0) or (year%400 ==0):
is_leap_year(year) = "是闰年"
else:
is_leap_year(year) = "不是闰年"
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:81:"Sorry: IndentationError: expected an indented block (__tester__.python3, line 5)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandbo... | 106,338 | 2 | 0 | No error | No error | Sorry: IndentationError: expected an indented block (__tester__.python3, line 5)
| IndentationError | IndentationError | IndentationError | error |
30,506 | 906 | 列表LAB3 | 544 | 请写一个函数add_matrix(),传入两个二维列表参数matrix_1, matrix_2; 其中每个有n个长度为m的列表,其中都是int,返回一个二维列表,内容是前两个列表的和(对应的位置相加)。
例1:
输入
matrix_1 = [[7, 8],
[4, 1]]
matrix_2 = [[3, 7],
[4, 3]]
返回
[[10, 15],
[8, 4]]
例2:
输入
matrix_1 = [[0]]
matrix_2 = [[1]]
返回
[[1]]
例3:
输入
matrix_1 = [[1, 1, 1],
[2, 1... | import ast
input_list_1 = ast.literal_eval(input())
input_list_2 = ast.literal_eval(input())
# 请不要更改此行以上的代码
def add_matrix(matrix_1, matrix_2):
for i in range(0, len(matrix_1)):
for j in range(0, len(matrix_1[i])):
matrix_1[i][j] = matrix_1[i][j] + matrix_2[i][j]
return matrix_1
# 请不要更改此行以... | 104,869 | todo | 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[0])):
matrix_1[i][j]=matrix_1[i][j]+matrix_2[i][j]
return matrix_1
print(add_matrix(matrix_1,matrix_2)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"565";s:10:"questionid";s:3:"544";s:8:"testtype";s:1:"0";s:8:"... | 452,457 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 9, in <module>
print(add_matrix(matrix_1,matrix_2))
NameError: name 'matrix_1' is not defined
" | NameError | No error | No error | NameError | NameError | error |
41,871 | 1,365 | 输入和输出 1.10 | 2,925 | 按要求写出代码。
* 要求:
* 打印:"生日快乐!"(不打印引号)
| print("生日快乐!") | 161,729 | complete | print("生日快乐!") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2253";s:10:"questionid";s:4:"2925";s:8:"testtype";s:1:"0";s:8... | 677,232 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
29,757 | 776 | 递归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)) | 96,278 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def fib_3(num):
if num ==1
# 在这里补充代码:
return 1
# 在这里补充代码
elif num == 2
# 在这里补充代码:
return 1
# 在这里补充代码
elif # 在这里补充代码:
# 在这里补充代码
else:
return fib_3(num-1)+fib_3(num-2)+fib_3(num-3)
# 在这里补充代码
# 请不要更改此行以下的代码
pri... | 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:95:" File "__tester__.python3", line 5
if num ==1
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:6;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";... | 464,441 | 2 | 0 | No error | No error | File "__tester__.python3", line 5
if num ==1
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
40,092 | 1,218 | 循环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) | 155,220 | todo | param = int(input())
double_until_one_thousand = param
print(double_until_one_thousand)
while(double_until_one_thousand<=1000):
double_until_one_thousand =double_until_one_thousand*2
# 在此处补全代码
double_until_one_thousand(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2074";s:10:"questionid";s:4:"2432";s:8:"testtype";s:1:"0";s:8... | 648,864 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 8, in <module>
double_until_one_thousand(param)
TypeError: 'int' object is not callable
" | TypeError | No error | No error | TypeError | TypeError | error |
43,870 | 2,046 | 分支 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) | 168,352 | complete | num_spiders=int(input())
web_size=1
if num_spiders==10:
web_size=web_size*2
else:
web_size=web_size*3
num_spiders=num_spiders+5
print(num_spiders,web_size) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2315";s:10:"questionid";s:4:"3126";s:8:"testtype";s:1:"0";s:8... | 703,721 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
2,361 | 27 | 判断1 | 69 | 补全代码,定义一个函数get_discount(),如果用户的身高小于140(不含),返回票价0,否则返回票价100。
| param = int(input())
def get_discount(height):
if (height < 140):
return 0
else:
return 100
print(get_discount(param)) | 3,515 | complete | param = int(input())
def get_discount(param):
if(param<140):
return(0)
else:
return(100)
print(get_discount(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:2:"48";s:10:"questionid";s:2:"69";s:8:"testtype";s:1:"0";s:8:"te... | 19,531 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
7,959 | 141 | 列表3.3 | 476 | 请编写一个函数palindrome(),传入一个列表参数my_list,其中的值都是长度为1的string,返回一个boolean,判断在去掉最后一位和第一位后,该列表是否是回文。
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果(可以更改原列表的内容)。
| temp_list = input().split(',')
# 请不要更改此行以上的代码
def palindrome(my_list):
my_list.pop()
my_list.remove(my_list[0])
return my_list == my_list[::-1]
# 请不要更改此行以下的代码
print(palindrome(temp_list)) | 16,426 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
new_list=[]
def palindrome(temp_list):
new_list = temp_list.copy()
del new_list[0]
new_list.pop()
print(new_list)
for i in range(1,len(new_list)-1):
if new_list==[]:
return True
elif new_list[i] == new_list[len(new_list)-1-i]:
return ... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:8;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:0;s:11:"testresults";a:8:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"514";s:10:"questionid";s:3:"476";s:8:"testtype";s:1:"0";s:8:"... | 132,700 | 1 | 8 | No error | No error | No error | No error | No error | LogicError | error |
14,180 | 469 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 37,057 | 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... | 168,454 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
47,886 | 2,179 | 列表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)) | 182,927 | todo | input_int = int(input())
input_int_2 = int(input())
input_int_3 = int(input())
# 请不要更改此行以上的代码
def create_matrix(r,c,val):
#len(create_matrix)==r
create_matrix=[[create_matrix[val]*c]*r]
return [[[val]*c]*r]
# 请不要更改此行以下的代码
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: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:"599";s:10:"questionid";s:3:"549";s:8:"testtype";s:1:"0";s:8:"... | 759,264 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 12, in <module>
print(create_matrix(input_int, input_int_2, input_int_3))
File "__tester__.python3", line 7, in create_matrix
create_matrix=[[create_matrix[val]*c]*r]
UnboundLocalError: local variable 'create_matrix' referenced b... | UnboundLocalError | No error | No error | UnboundLocalError | UnboundLocalError | error |
4,454 | 64 | 递归1.2 | 294 | 补全代码,使其打印出还有几天到周日。
例如输入3,则打印
还有4天到周日
还有3天到周日
还有2天到周日
还有1天到周日
到周日了!
| input_int = int(input())
# 请不要更改此行以上的代码
def days_left_to_sunday(day):
if day < 7:
print("还有" + str(7 - day) + "天到周日")
days_left_to_sunday(day + 1)
else:
print("到周日了!")
# 请不要更改此行以下的代码
days_left_to_sunday(input_int) | 7,127 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def days_left_to_sunday(day):
if day < 7:
print("还有" + str(7 - day) + "天到周日")
day_left_to_sunday(day-1)
#在这里添加一行代码
else:
print("到周日了!")
# 请不要更改此行以下的代码
days_left_to_sunday(input_int) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:1;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"304";s:10:"questionid";s:3:"294";s:8:"testtype";s:1:"0";s:8:"... | 37,152 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 13, in <module>
days_left_to_sunday(input_int)
File "__tester__.python3", line 7, in days_left_to_sunday
day_left_to_sunday(day-1)
NameError: name 'day_left_to_sunday' is not defined
" | NameError | No error | No error | NameError | NameError | error |
35,201 | 1,168 | 块&缩进 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('蜘蛛很少') | 136,834 | complete | num_spiders = int(input())
num_cats = int(input())
if num_spiders < 10:
print('蜘蛛很少')
elif num_cats > num_spiders:
print("猫会吃掉蜘蛛")
else:
print("猫吃不完蜘蛛") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2405";s:10:"questionid";s:4:"3464";s:8:"testtype";s:1:"0";s:8... | 580,314 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
9,606 | 173 | 字典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]... | 22,618 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
user_info = {}
def log_user(user_name):
if user_name in user_info:
user_info[user_name] += 1
else:
user_info[user_name] == 1
def print_user_log(user_name):
if user_name in user_info:
print(user_... | 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:"... | 110,486 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 19, in <module>
log_user(i)
File "__tester__.python3", line 11, in log_user
user_info[user_name] == 1
KeyError: 'Circle'
" | KeyError | No error | No error | KeyError | KeyError | error |
29,674 | 811 | 列表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)) | 94,751 | todo | my_list = input().split(',')
new_list = []
# 请不要更改此行以上的代码
# 在这里编写代码
for i in my_list:
new_list.insert(-1,my_list.pop(i))
# 请不要更改此行以下的代码
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: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:"484";s:10:"questionid";s:3:"470";s:8:"testtype";s:1:"0";s:8:"... | 412,795 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 7, in <module>
new_list.insert(-1,my_list.pop(i))
TypeError: 'str' object cannot be interpreted as an integer
" | TypeError | No error | No error | TypeError | TypeError | error |
24,385 | 470 | 字典LAB1 | 553 | 【用户名密码验证】
编写一个程序做到添加/验证用户名密码,包含两个函数:
add_user(user_name, pass_word) 不返回任何信息,用于添加一个用户,用户名是user_name,密码是pass_word
verify_user(user_name, pass_word)返回Boolean值(代表用户名密码是否正确),如果存在用户名为user_name,密码为pass_word的用户,则返回True,密码错误或者用户不存在则返回False
如:
add_user("circle", "cat")
print(verify_user("circle","cat"))
print(verify_user("... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
return False
# 请不要... | 66,790 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info={}
def add_user(user_name,pass_word):
user_info['user_name']=='pass_word'
def verify_user(user_name,pass_word):
if 'user_name'in user_info:
if user_info['user_name']='pass_word':
return True
return Fals... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:139:" File "__tester__.python3", line 9
if user_info['user_name']='pass_word':
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:... | 294,082 | 2 | 0 | No error | No error | File "__tester__.python3", line 9
if user_info['user_name']='pass_word':
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
36,835 | 1,267 | 加法 | 326 | 写一行代码,将 功德 (karma) 加一。
如:
karma = 5
则输出
6
| karma = int(input())
karma = karma + 1
print(karma) | 145,813 | complete | karma = int(input())
karma = karma + 1
print(karma) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"370";s:10:"questionid";s:3:"326";s:8:"testtype";s:1:"0";s:8:"... | 607,097 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
32,316 | 789 | 范围 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('到齐了')
| 119,758 | complete | num_students=int(input())
if num_students<50:
print('没到齐')
else:
print('到齐了') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2350";s:10:"questionid";s:4:"3281";s:8:"testtype";s:1:"0";s:8... | 505,582 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
44,924 | 2,084 | 循环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)) | 172,919 | todo | param = int(input())
def count_ones(param):
count = 0
for i in str(param):
if i == "1":
count_ones += 1
return 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: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:"... | 720,460 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 9, in <module>
print(count_ones(param))
File "__tester__.python3", line 7, in count_ones
count_ones += 1
UnboundLocalError: local variable 'count_ones' referenced before assignment
" | UnboundLocalError | No error | No error | UnboundLocalError | UnboundLocalError | error |
44,273 | 2,063 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 169,764 | todo | print('00000\n 0 0 0\n 00000') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2226";s:10:"questionid";s:4:"2862";s:8:"testtype";s:1:"0";s:8... | 709,541 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.