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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,781 | 4 | 列表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)) | 6,655 | complete | temp_list = input().split(',')
# 请不要更改此行以上的代码
def count_negative(temp_list):
n = 0
for i in range (0, len(temp_list)):
if int(temp_list[i]) < 0:
n += 1
return n
# 请不要更改此行以下的代码
print(count_negative(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"173";s:10:"questionid";s:3:"238";s:8:"testtype";s:1:"0";s:8:"... | 33,338 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
41,186 | 1,134 | 列表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)) | 159,737 | complete | temp_list = input().split(',')
# 请不要更改此行以上的代码
def count_negative(my_list):
num=0
for i in my_list:
i=int(i)
if i<0:
num+=1
return num
# 请不要更改此行以下的代码
print(count_negative(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"501";s:10:"questionid";s:3:"474";s:8:"testtype";s:1:"0";s:8:"... | 669,484 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
46,715 | 2,271 | 分支1.7 | 10,438 | 按要求写出代码。
* 要求:
* 把用户输入的一个值转换成int并存入变量num_spiders。
* 如果num_spiders不等于15,给变量web_size赋值为20;
* 否则,给变量web_size赋值为num_spiders。
* 最后,无论num_spiders是多少,都把web_size乘2。
* 打印web_size。
例1:
输入:15
输出:30
解释:num_spiders等于15,所以web_size被赋值为15。最后web_size乘2,所以web_size为30。
例2:
输入:17
输出:40
解释:num_spiders不等于15,所以web_size等于20。最后... | num_spiders = int(input())
if num_spiders != 15:
web_size = 20
else:
web_size = num_spiders
web_size = 2 * web_size
print(web_size) | 180,182 | complete | num_spiders = int(input())
if num_spiders != 15:
web_size = 20
else :
web_size = num_spiders
web_size = web_size *2
print(web_size) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"5294";s:10:"questionid";s:5:"10438";s:8:"testtype";s:1:"0";s:... | 748,164 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
47,916 | 2,324 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 182,976 | todo | print('0000')
print("0 0 0")
print('00000') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2226";s:10:"questionid";s:4:"2862";s:8:"testtype";s:1:"0";s:8... | 759,490 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
25,151 | 659 | 递归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)) | 69,223 | todo | input_int = int(input())
# 请不要更改此行以上的代码
def fib_3(num):
if num == 0:
return 1
elif num == 1:
return # 在这里补充代码
elif num == 2:
return 1
else:
return fib_3(num-1) + fib_3(num-2) + fib_3(num-3)
# 请不要更改此行以下的代码
print(fib_3(input_int)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:6;s:10:"actualmark";d:2;s:11:"testresults";a:4:{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:"... | 306,440 | 1 | 2 | ***运行错误***
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-1) + fib_3(num-2) + fib_3(num-3)
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'
" | TypeError | No error | No error | TypeError | TypeError | error |
16,048 | 515 | 范围 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('睡觉了') | 43,119 | todo | 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:3;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:2;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2380";s:10:"questionid";s:4:"3293";s:8:"testtype";s:1:"0";s:8... | 193,933 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
21,752 | 590 | 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)) | 60,686 | todo | year = int(input())
def is_leap_year(year):
if year/4==int()
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:107:" File "__tester__.python3", line 4
if year/4==int()
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sou... | 264,708 | 2 | 0 | No error | No error | File "__tester__.python3", line 4
if year/4==int()
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
932 | 30 | 循环3.4 | 95 | 编写一个函数count_ones,输入一个int,数有几位1。
例:
输入:100010010
返回:3
| param = int(input())
def count_ones(param):
count = 0
for i in str(param):
if i == "1":
count += 1
return count
print(count_ones(param)) | 1,355 | complete | param = int(input())
def count_ones(num):
count=0
for i in str(num):
if i==str(1):
count=count+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: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:"94";s:10:"questionid";s:2:"95";s:8:"testtype";s:1:"0";s:8:"te... | 17,478 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
23,702 | 817 | 输入和输出 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) | 65,492 | todo | a=int(input('输入数字 '))
b=int(input('输入数字 '))
print(a+b)
| O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2410";s:10:"questionid";s:4:"3474";s:8:"testtype";s:1:"0";s:8... | 288,153 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
2,321 | 51 | 循环LAB3 | 98 | 编写一个函数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) | 3,338 | todo | param = input()
param = input()
import re
def count_spaces_and_commas(param):
comma = "[,]"
blank = "[ ]"
comma_numbers = 0
blank_numbers = 0
for i in param:
if(re.match(comma,i)) != None:
comma_numbers += 1
if(re.match(blank,i)) != None:
blank_numbers += 1
return comma_numbers,blank_number... | 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:"107";s:10:"questionid";s:2:"98";s:8:"testtype";s:1:"0";s:8:"t... | 18,759 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 2, in <module>
param = input()
EOFError: EOF when reading a line
" | EOFError | No error | No error | EOFError | EOFError | error |
46,239 | 1,057 | 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)) | 178,598 | complete | x = int(input())
y = int(input())
z = int(input())
def smallest_among_three(a,b,c):
if a<=b and a<=c:
return a
elif c<=a and c<=b:
return c
else:
return b
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:"... | 742,584 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
22,335 | 701 | 循环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) | 61,755 | complete | param = input()
# 在此处编写代码
def count_spaces_and_commas(param):
x = 0
y = 0
for i in param:
if i == ',':
x += 1
if i == ' ':
y += 1
print('有'+str(x)+'个逗号和'+str(y)+'个空格')
count_spaces_and_commas(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:4;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"464";s:10:"questionid";s:3:"399";s:8:"testtype";s:1:"0";s:8:"... | 276,495 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,952 | 448 | 判断debug2 | 369 | 以下有一个函数print_num, 若输入的内容等于10,则将其打印出来,否则什么也不做。
代码中有错误,请改正其中的错误。
| param = int(input())
def print_num(input_num):
if (input_num == 10):
print(input_num)
print_num(param) | 36,252 | complete | param = int(input())
def print_num(param):
if param ==10:
print (param)
print_num(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"423";s:10:"questionid";s:3:"369";s:8:"testtype";s:1:"0";s:8:"... | 163,575 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
20,401 | 692 | 输入和输出 1.10 | 2,925 | 按要求写出代码。
* 要求:
* 打印:"生日快乐!"(不打印引号)
| print("生日快乐!") | 57,340 | 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... | 248,417 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
2,424 | 32 | 列表3.2 | 161 | 请编写一个函数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)) | 3,774 | complete | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def count_negative(temp_list):
y=len(temp_list)
count= 0
for i in range (0,y):
z=float(temp_list[i])
if z<0 :
count=count+1
return count
# 请不要更改此行以下的代码
print(count_negative(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"137";s:10:"questionid";s:3:"161";s:8:"testtype";s:1:"0";s:8:"... | 20,641 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
31,138 | 66 | 分支 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) | 110,600 | 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... | 469,522 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
5,939 | 268 | 加法 | 326 | 写一行代码,将 功德 (karma) 加一。
如:
karma = 5
则输出
6
| karma = int(input())
karma = karma + 1
print(karma) | 11,565 | todo | karma = int(input(5))
karma=str(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:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"370";s:10:"questionid";s:3:"326";s:8:"testtype";s:1:"0";s:8:"... | 59,114 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
20,175 | 616 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 56,771 | todo | age = int(input())
print("my age is ", age) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:0;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"377";s:10:"questionid";s:3:"339";s:8:"testtype";s:1:"0";s:8:"... | 246,682 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
1,857 | 44 | LAB2.2 | 75 | 补全以下代码,判断该年份是否是闰年。
如果是闰年,则打印“是闰年”;
否则,打印“不是闰年”。
| 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)) | 2,708 | todo | i = int(input())
def is_leap_year(year):
# 在这里补全代码
if (year % 4 == 0):
return "是闰年"
else:
return "不是闰年"
print(is_leap_year(i)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:132:" File "__tester__.python3", line 5
if (year % 4 == 0):
^
SyntaxError: invalid character in identifier
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testr... | 14,294 | 2 | 0 | No error | No error | File "__tester__.python3", line 5
if (year % 4 == 0):
^
SyntaxError: invalid character in identifier
| SyntaxError | SyntaxError | SyntaxError | error |
26,256 | 458 | 字典LAB0.2 | 551 | 提供一个int字典my_dict,若其中含有key为1,3,5,7的项,则将这些项删除。
如:
my_dict = {1:0, 3:1, 5:9, 7:16}
执行完毕后应为:
my_dict = {}
如:
my_dict = {1:7, 5:9, 0:20}
执行完毕后应为:
my_dict = {0:20}
如:
my_dict = {0:20, 2:40, 4:60}
执行完毕后应为:
my_dict = {0:20, 2:40, 4:60}
| input_dict = input()
my_dict = eval(input_dict)
# 请不要更改此行以上的代码
to_delete = [1,3,5,7]
for i in to_delete:
if i in my_dict:
del my_dict[i]
# 请不要更改此行以下的代码
print(my_dict) | 72,200 | todo | input_dict = input()
my_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
my_dict={}
key=[1,3,5,7]
for i in my_dict:
for i in key:
del my_dict[i]
# 请不要更改此行以下的代码
print(my_dict) | 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:4;s:10:"actualmark";d:2;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"609";s:10:"questionid";s:3:"551";s:8:"testtype";s:1:"0";s:8:"... | 322,821 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
48,198 | 2,340 | 函数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() | 184,027 | 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... | 763,916 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
34,180 | 1,119 | 字典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... | 129,219 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
a={}
def log_user(user_name):
global a
a[user_name]=0
if user_name in a:
a[user_name]=a[user_name]+1
else:
a[user_name]=0
def print_user_log(user_name):
print (a[user_name])
# 请不要更改此行以下的代码
for i in i... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d: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... | 548,385 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 20, in <module>
print_user_log(i)
File "__tester__.python3", line 14, in print_user_log
print (a[user_name])
KeyError: 'Flirter'
" | KeyError | No error | No error | KeyError | KeyError | error |
40,771 | 1,302 | 字典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]
... | 158,102 | todo | input_str = input()
# 请不要更改此行以上的代码
# 在这里编写代码
position={}
str(res)==""
int(pos)=len(input_str)
def get_first_duplicate(input_str):
for i in input_str:
if i not in position:
position[i]=input_str[i]
if i in position:
if positon[i]<pos:
i=res
... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:164:" File "__tester__.python3", line 7
int(pos)=len(input_str)
^^^^^^^^
SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='?
";s:11:"maxpossmark";d:7... | 662,782 | 2 | 0 | No error | No error | File "__tester__.python3", line 7
int(pos)=len(input_str)
^^^^^^^^
SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='?
| SyntaxError | SyntaxError | SyntaxError | error |
16,212 | 593 | 分支 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) | 43,345 | complete | user_age=int(input())
if user_age == 18:
num_candles=18
else:
num_candles=3
print(num_candles) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2425";s:10:"questionid";s:4:"3477";s:8:"testtype";s:1:"0";s:8... | 193,771 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
25,385 | 637 | 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)) | 70,074 | todo | i = int(input())
def is_leap_year(year):
# 在这里补全代码
if year%400==0:
return '是闰年'
elif year%4==0:
return '是闰年'
else:
return '不是闰年'
print(is_leap_year(i)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"403";s:10:"questionid";s:3:"348";s:8:"testtype";s:1:"0";s:8:"... | 310,335 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
4,580 | 64 | 字典LAB3 | 297 | 【(附加题)找出第一个重复的字符】
编写一个函数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... | 7,273 | todo | input_str = input()
# 请不要更改此行以上的代码
duplicate_info={}
for i in input_str:
if i not in duplicate_info:
duplicate_info[i]=1
elif i in duplicate_info:
duplicate_info[i]+=1
for j in duplicate_info:
if duplicate_info[j]>1:
print(duplicate_info[i])
break
# 在这里编写代码
... | 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:7;s:10:"actualmark";d:1;s:11:"testresults";a:7:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"319";s:10:"questionid";s:3:"297";s:8:"testtype";s:1:"0";s:8:"... | 37,808 | 1 | 6 | No error | No error | No error | No error | No error | LogicError | error |
10,770 | 141 | 分支 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) | 26,450 | 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... | 122,019 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
33,606 | 1,163 | 范围 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('到齐了')
| 125,803 | 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... | 533,989 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
5,056 | 49 | 判断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)) | 7,777 | complete | param = int(input())
def get_age_status(param):
if 0 <= param < 18:
return '未成年人'
elif 18 <= param < 65:
return '工作中'
else:
return '退休了'
print(get_age_status(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"413";s:10:"questionid";s:3:"367";s:8:"testtype";s:1:"0";s:8:"... | 41,046 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
33,982 | 1,166 | 范围 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('睡觉了') | 127,465 | 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... | 538,883 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
22,797 | 673 | 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)) | 63,030 | todo | i = int(input())
def is_leap_year(year):
if year%4==0 and year%100!=0 and year%400==0:
return '是闰年'
else:
return '不是闰年'
print(is_leap_year(i)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:3;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"403";s:10:"questionid";s:3:"348";s:8:"testtype";s:1:"0";s:8:"... | 275,906 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
26,797 | 850 | 输入和输出 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) | 75,102 | complete | a = int(input())
b = int(input())
print(a+b)
| O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2410";s:10:"questionid";s:4:"3474";s:8:"testtype";s:1:"0";s:8... | 349,462 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
25,110 | 458 | 列表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)) | 68,827 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def get_max(temp_list):
my_list=[]
for i in temp_list:
my_list.append(i)
return max(my_list)
# 请不要更改此行以下的代码
print(get_max(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"... | 310,763 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
42,858 | 349 | 列表LAB1 | 542 | 写一个函数replace_element_in_list(),传入三个参数:input_list (string格式的整数列表), num_from (int), num_to (int),
将input_list中所有的num_from换成num_to。
比如:
input_list = ['1','2','3','4','1','2','3','2']
num_from = 2
num_to = 10
执行完毕后,input_list = ['1','10','3','4','1','10','3','10']
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果,直接更改原列表并返回。
| input_list = input().split(',')
num_1 = int(input())
num_2 = int(input())
# 请不要更改此行以上的代码
def replace_element_in_list(input_list, num_from, num_to):
for i in range(0, len(input_list)):
if int(input_list[i]) == num_from:
input_list[i] = str(num_to)
return input_list
# 请不要更改此行以下的代码
print(repl... | 163,879 | complete | input_list = input().split(',')
num_1 = int(input())
num_2 = int(input())
# 请不要更改此行以上的代码
def replace_element_in_list(input_list, num_1, num_2):
for i in range(len(input_list)):
if input_list[i]==str(num_1):
input_list[i]=str(num_2)
return input_list
# 请不要更改此行以下的代码
print(replace_element_in_list(inpu... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:4;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"555";s:10:"questionid";s:3:"542";s:8:"testtype";s:1:"0";s:8:"... | 686,148 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
41,615 | 1,339 | 分支 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) | 160,966 | complete | user_age=int(input())
if user_age == 18:
num_candles = 18
else:
num_candles = 3
print(num_candles) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2425";s:10:"questionid";s:4:"3477";s:8:"testtype";s:1:"0";s:8... | 674,269 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
39,045 | 1,218 | 变量和赋值 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) | 152,337 | todo | num_cats=input()
num_dogs=input()
print(num_cats+num_dogs)
print(" ") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2285";s:10:"questionid";s:4:"3018";s:8:"testtype";s:1:"0";s:8... | 634,716 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
17,948 | 604 | 输入和输出 1.2 | 2,860 | 打印字符串:
I am Python!
| print("I am Python!") | 49,540 | 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... | 219,629 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
20,103 | 763 | 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) | 56,536 | todo | print('I can')
print('swim')
my_age = 10
print('my_age:' , my_age) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2279";s:10:"questionid";s:4:"2974";s:8:"testtype";s:1:"0";s:8... | 251,786 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
289 | 35 | 硬币数 | 29 | 补全以下代码,将所有种类硬币的和打印出来。
| num_yuan = int(input())
num_jiao = int(input())
num_coins = num_yuan + num_jiao
print(num_coins) | 391 | 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:2:"13";s:10:"questionid";s:2:"29";s:8:"testtype";s:1:"0";s:8:"te... | 1,558 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
29,973 | 718 | 循环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)) | 99,746 | todo | param = int(input())
count=0
# 在此处编写代码
for i in str(param):
if i!='1':
continue
count+=count
print(count) | 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:"451";s:10:"questionid";s:3:"396";s:8:"testtype";s:1:"0";s:8:"... | 433,248 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
10,924 | 412 | 块&缩进 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('蜘蛛很少') | 27,139 | todo | num_spiders = int(input())
num_cats = int(input())
if num_spiders>10 and num_cats>num_spiders:
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:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:4;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2405";s:10:"questionid";s:4:"3464";s:8:"testtype";s:1:"0";s:8... | 125,016 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
43,766 | 2,030 | 输入和输出 1.13 | 2,931 | 按要求写出代码。
* 要求:
* 把用户输入的值打印出来。
* 最后有一个空行。
例1:
输入:3
输出:3
例2:
输入:hi
输出:hi
| result = input()
print(result) | 168,004 | todo | a=input()
print('input()') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2263";s:10:"questionid";s:4:"2931";s:8:"testtype";s:1:"0";s:8... | 702,518 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
47,461 | 2,313 | 输入和输出 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) | 182,220 | todo | number_1=int(input(''))
number_2=int(input('4'))
num_number=number_1+number_2
print("7") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2410";s:10:"questionid";s:4:"3474";s:8:"testtype";s:1:"0";s:8... | 755,891 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
30,318 | 301 | 分支 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) | 103,152 | todo | user_age = int(input())
if user_age == 18:
print("num_candles = 18")
else:
print("num_candles = 3")
print("num_candles") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2425";s:10:"questionid";s:4:"3477";s:8:"testtype";s:1:"0";s:8... | 440,700 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
45,539 | 2,129 | 列表LAB1 | 542 | 写一个函数replace_element_in_list(),传入三个参数:input_list (string格式的整数列表), num_from (int), num_to (int),
将input_list中所有的num_from换成num_to。
比如:
input_list = ['1','2','3','4','1','2','3','2']
num_from = 2
num_to = 10
执行完毕后,input_list = ['1','10','3','4','1','10','3','10']
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果,直接更改原列表并返回。
| input_list = input().split(',')
num_1 = int(input())
num_2 = int(input())
# 请不要更改此行以上的代码
def replace_element_in_list(input_list, num_from, num_to):
for i in range(0, len(input_list)):
if int(input_list[i]) == num_from:
input_list[i] = str(num_to)
return input_list
# 请不要更改此行以下的代码
print(repl... | 175,230 | todo | input_list = input().split(',')
num_1 = int(input())
num_2 = int(input())
# 请不要更改此行以上的代码
# 在这里编写代码
def replace_element_in_list(input_list, num_1, num_2):
for i in range (len(input_list)):
if input_list[i] == str(num_01):
input_list[i] = str(num_2)
return input_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:"555";s:10:"questionid";s:3:"542";s:8:"testtype";s:1:"0";s:8:"... | 729,636 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 15, in <module>
print(replace_element_in_list(input_list, num_1, num_2))
File "__tester__.python3", line 9, in replace_element_in_list
if input_list[i] == str(num_01):
NameError: name 'num_01' is not defined. Did you mean: 'num_1... | NameError | No error | No error | NameError | NameError | error |
8,313 | 320 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 17,755 | complete | print(input() + ' 岁') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2273";s:10:"questionid";s:4:"2933";s:8:"testtype";s:1:"0";s:8... | 115,833 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
34,537 | 1,130 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 130,762 | todo | print('8', end=' ')
print('岁')
print('12', end=' ')
print('岁') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2273";s:10:"questionid";s:4:"2933";s:8:"testtype";s:1:"0";s:8... | 549,487 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
30,912 | 898 | LAB1.2 | 6,216 | 运动中消耗的卡路里是
(年龄的0.2757倍 体重的0.03295倍 心率的1.0781倍 )的和
减去75.4991后,得到的结果乘以时间,再除以 8.368。
补全下列代码,给定了年龄,体重,心率,时间,计算出卡路里的消耗量
| age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
calories_burned = ((age * 0.2757) + (weight * 0.03295) + (heart_rate * 1.0781) - 75.4991) * time / 8.368
print(calories_burned) | 109,037 | todo | age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
# 在此处补全代码
calories_burned = time*(sum(0.2757*age,0.03295*weight,1.0781*heart_rate)-75.4991)/8.368
print(calories_burned) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"3178";s:10:"questionid";s:4:"6216";s:8:"testtype";s:1:"0";s:8... | 525,326 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 7, in <module>
calories_burned = time*(sum(0.2757*age,0.03295*weight,1.0781*heart_rate)-75.4991)/8.368
TypeError: sum() takes at most 2 arguments (3 given)
" | TypeError | No error | No error | TypeError | TypeError | error |
31,905 | 1,067 | 列表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)) | 118,065 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
def palindrome(l):
# 在这里编写代
for i in range(1,len(l)-1):
if(l[i]==l[len(l)-i-1]):
continue
else:
return False
break
return True
# 请不要更改此行以下的代码
print(palindrome(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"514";s:10:"questionid";s:3:"476";s:8:"testtype";s:1:"0";s:8:"... | 502,446 | 1 | 6 | No error | No error | No error | No error | No error | LogicError | error |
38,632 | 1,134 | 判断1 | 366 | 补全代码,定义一个函数get_discount(),如果用户的身高小于140(不含),返回票价0,否则返回票价100。
| param = int(input())
def get_discount(height):
if (height < 140):
return 0
else:
return 100
print(get_discount(param)) | 151,350 | todo | param = int(input())
def get_discount(param):
if param<140:
get_discount()=0
else:
get_discount()=100
print(get_discount(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:108:" File "__tester__.python3", line 4
get_discount()=0
^
SyntaxError: cannot assign to function call
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"so... | 630,942 | 2 | 0 | No error | No error | File "__tester__.python3", line 4
get_discount()=0
^
SyntaxError: cannot assign to function call
| SyntaxError | SyntaxError | SyntaxError | error |
44,525 | 2,047 | 循环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,117 | todo | param = int(input())
def count_ones(number):
count = 0
while number > 0:
if number & 1 == 1:
count += 1
number = number >> 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:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"451";s:10:"questionid";s:3:"396";s:8:"testtype";s:1:"0";s:8:"... | 716,973 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
14,391 | 140 | 递归2.3 | 609 | 设计一个函数palindrom(x, y), 打印以0为中心向两边展开x次,每次递增y的回文。
例1:
输入: 0 1
输出: "0"
解释: x是0, 不往两边展开.
例2:
输入: 1 3
输出: "3 0 3"
解释: x是1, 往两边展开1次, y是3, 每次增加3.
例3:
输入: 2 5
输出: "10 5 0 5 10"
解释: x是2, 往两边展开2次, y是5, 每次增加5.
| input_int_0 = int(input())
input_int_1 = int(input())
# 请不要更改此行以上的代码
def palindrome(x, y):
if x == 0:
return "0"
else:
left = str(x * y) + " "
mid = palindrome(x - 1, y)
right = " " + str(x * y)
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int_0,... | 37,554 | complete | input_int_0 = int(input())
input_int_1 = int(input())
# 请不要更改此行以上的代码
def palindrome(x, y):
# 在这里补全代码
if x == 0:
return "0"# 在这里补全代码
else:
left =str(y*x) + " "# 在这里补全代码
mid = palindrome(x-1,y) # 在这里补全代码
right =" " + str(y*x)# 在这里补全代码
return left + mid + r... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"694";s:10:"questionid";s:3:"609";s:8:"testtype";s:1:"0";s:8:"... | 170,753 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
24,201 | 642 | 循环1.7 | 2,432 | 编写一个函数double_until_one_thousand, 将其打印出来后,乘二,再打印,直至其大于1000。
| param = int(input())
def double_until_one_thousand(num):
while(num <= 1000):
print(num)
num *= 2
double_until_one_thousand(param) | 66,484 | todo | param = int(input())
# 在此处补全代码
def double_until_one_thousand(param):
while (parma<=1000):
print(param)
param*=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:107:"Sorry: IndentationError: unindent does not match any outer indentation level (__tester__.python3, line 10)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sou... | 292,948 | 2 | 0 | No error | No error | Sorry: IndentationError: unindent does not match any outer indentation level (__tester__.python3, line 10)
| IndentationError | IndentationError | IndentationError | error |
6,087 | 268 | Lab2.1 | 346 | 定义一个叫做smallest_among_three的函数,输入三个参数,打印最小的参数。
| x = int(input())
y = int(input())
z = int(input())
def smallest_among_three(x, y, z):
if (x < y):
if (x < z):
return x
else:
return z
else:
if (y < z):
return y
else:
return z
print(smallest_among_three(x, y, z)) | 11,756 | todo | x = int(input())
y = int(input())
z = int(input())
# 在这里补全代码
def smallest_among_three(x,y,z):
if x<y and x<z:
return x
if y<x and y<z:
return y
if z<x and z<y:
return z | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:3;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:0;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"395";s:10:"questionid";s:3:"346";s:8:"testtype";s:1:"0";s:8:"... | 60,333 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
13,064 | 382 | 循环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) | 33,781 | todo | param = input()
def count_spaces_and_commas(param):
x=str(param)
s = 0
c = 0
for i in x:
while i==",":
s=s+1
while i==" ":
c=c+1
print ('有'+str(s)+'个逗号和'+str(c)+'个空格')
count_spaces_and_commas(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:107:"Sorry: IndentationError: unindent does not match any outer indentation level (__tester__.python3, line 10)
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sou... | 180,530 | 2 | 0 | No error | No error | Sorry: IndentationError: unindent does not match any outer indentation level (__tester__.python3, line 10)
| IndentationError | IndentationError | IndentationError | error |
40,208 | 1,313 | 列表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)) | 155,538 | complete | temp_list = input().split(',')
# 请不要更改此行以上的代码
def count_negative(my_list):
count = 0
for num in my_list:
if int(num) < 0:
count += 1
return count
# 请不要更改此行以下的代码
print(count_negative(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"... | 650,494 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,791 | 140 | 字典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]
... | 35,857 | todo | input_str = input()
# 请不要更改此行以上的代码
# 在这里编写代码
position={}
res=""
pos=len(input_str)
def get_first_duplicate(input_str):
global pos
index=0
for word in input_str:
if (word not in position):
position[word]=index
else:
if (position[word]<pos):
... | 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:"... | 166,793 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 23, in <module>
print(get_first_duplicate(input_str))
File "__tester__.python3", line 19, in get_first_duplicate
return res
UnboundLocalError: local variable 'res' referenced before assignment
" | UnboundLocalError | No error | No error | UnboundLocalError | UnboundLocalError | error |
12,430 | 259 | 递归2.3 | 609 | 设计一个函数palindrom(x, y), 打印以0为中心向两边展开x次,每次递增y的回文。
例1:
输入: 0 1
输出: "0"
解释: x是0, 不往两边展开.
例2:
输入: 1 3
输出: "3 0 3"
解释: x是1, 往两边展开1次, y是3, 每次增加3.
例3:
输入: 2 5
输出: "10 5 0 5 10"
解释: x是2, 往两边展开2次, y是5, 每次增加5.
| input_int_0 = int(input())
input_int_1 = int(input())
# 请不要更改此行以上的代码
def palindrome(x, y):
if x == 0:
return "0"
else:
left = str(x * y) + " "
mid = palindrome(x - 1, y)
right = " " + str(x * y)
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int_0,... | 32,191 | complete | input_int_0 = int(input())
input_int_1 = int(input())
# 请不要更改此行以上的代码
def palindrome(input_int_0, input_int_1):
if input_int_0 == 0:
return 0
else:
left=str(input_int_0*input_int_1)
mid=str(palindrome((input_int_0)-1, input_int_1))
right=str(input_int_0*input_int_1)
... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"694";s:10:"questionid";s:3:"609";s:8:"testtype";s:1:"0";s:8:"... | 151,351 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
28,885 | 878 | 列表LAB0.2 | 548 | 请写一个函数multiply_lists(),传入一个列表参数my_list, 和一个int参数factor。
将my_list扩张到factor倍,并返回。
例如:
my_list = [1, 2]
factor = 3
返回 [1, 2, 1, 2, 1, 2]
请不要使用任何列表自带函数。
| import ast
input_list = ast.literal_eval(input())
input_int = int(input())
# 请不要更改此行以上的代码
def multiply_lists(my_list, factor):
return my_list * factor
# 请不要更改此行以下的代码
print(multiply_lists(input_list, input_int)) | 86,515 | todo | import ast
input_list = ast.literal_eval(input())
input_int = int(input())
# 请不要更改此行以上的代码
def multiply_lists(input_list, input_int):
my_list=input_list
if input_int>1:
my_list=my_list+input_list
input_int=input_int-1
return my_list
# 在这里编写代码
# 请不要更改此行以下的代码
print(multiply_lists(... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"594";s:10:"questionid";s:3:"548";s:8:"testtype";s:1:"0";s:8:"... | 384,645 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
2,471 | 28 | 列表3.2 | 161 | 请编写一个函数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)) | 3,947 | complete | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def count_negative(my_list):
count = 0
for i in range(len(my_list)):
if int(my_list[i]) < 0 :
count += 1
return count
# 请不要更改此行以下的代码
print(count_negative(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"137";s:10:"questionid";s:3:"161";s:8:"testtype";s:1:"0";s:8:"... | 20,553 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
2,404 | 90 | 函数1.0 | 106 | 定义一个叫做 WELCOME_TO_CIRLCLE_CAT() 的函数,它的内容是打印以下这句话
"Welcome to circle cat!"
并使用这个函数2次(不包含题目内的一次)。
| def welcome_to_cirlcle_cat():
print("Welcome to circle cat!")
welcome_to_cirlcle_cat()
welcome_to_cirlcle_cat()
# 请不要更改此行以下的代码
welcome_to_cirlcle_cat() | 3,701 | todo | # 在这里编写代码
welcome_to_cirlcle_cat():
print("Welcome to circle cat!")
# 请不要更改此行以下的代码
welcome_to_cirlcle_cat()
welcome_to_cirlcle_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:125:" File "__tester__.python3", line 2
welcome_to_cirlcle_cat():
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:1;s:10:"actualmark";i:0;s:11:"testresult... | 19,841 | 2 | 0 | No error | No error | File "__tester__.python3", line 2
welcome_to_cirlcle_cat():
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
37,705 | 932 | 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)) | 148,019 | 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
else:
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:"... | 615,656 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
36,204 | 812 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 141,440 | todo | age = int(input())
print("my age is ",age) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:0;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"377";s:10:"questionid";s:3:"339";s:8:"testtype";s:1:"0";s:8:"... | 595,885 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
3,257 | 95 | 列表LAB3 | 245 | 请写一个函数add_matrix(),传入两个二维列表参数matrix_1, matrix_2; 其中每个有n个长度为m的列表,其中都是int,返回一个二维列表,内容是前两个列表的和(对应的位置相加)。
例1:
输入
matrix_1 = [[7, 8],
[4, 1]]
matrix_2 = [[3, 7],
[4, 3]]
返回
[[10, 15],
[8, 4]]
例2:
输入
matrix_1 = [[0]]
matrix_2 = [[1]]
返回
[[1]]
例3:
输入
matrix_1 = [[1, 1, 1],
[2, 1... | import ast
input_list_1 = ast.literal_eval(input())
input_list_2 = ast.literal_eval(input())
# 请不要更改此行以上的代码
def add_matrix(matrix_1, matrix_2):
for i in range(0, len(matrix_1)):
for j in range(0, len(matrix_1[i])):
matrix_1[i][j] = matrix_1[i][j] + matrix_2[i][j]
return matrix_1
... | 5,857 | complete |
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):
add_matrix = input_list_1[::]
m = len(input_list_1)
n = len(input_list_1[0])
for i in range(m):
for j in range(n):
... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:8;s:11:"testresults";a:8:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"199";s:10:"questionid";s:3:"245";s:8:"testtype";s:1:"0";s:8:"... | 28,068 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
10,928 | 140 | 循环2.3 | 388 | 补全以下代码,使其打印0到5的所有值。
| for i in range(0, 10):
print(i)
if (i == 5):
break | 27,163 | complete | for i in range(0, 10):
print(i)
# 在这里补全代码
if (i==5):
break | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"431";s:10:"questionid";s:3:"388";s:8:"testtype";s:1:"0";s:8:"... | 126,375 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
19,994 | 498 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 55,919 | todo | age = int(input())
print("my age is ",age) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:0;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"377";s:10:"questionid";s:3:"339";s:8:"testtype";s:1:"0";s:8:"... | 243,700 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
1,779 | 67 | 循环3.3 | 94 | 请逐位打印一个字符串。
如:
输入:CircleCat
输出
C
i
r
c
l
e
c
a
t
| param = input()
for i in param:
print(i) | 2,569 | todo | param = input()
for i in param:
print(param)
# 在此处补全答案 | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:4;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:2:"90";s:10:"questionid";s:2:"94";s:8:"testtype";s:1:"0";s:8:"te... | 14,921 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
3,817 | 20 | 字典LAB1 | 256 | 【用户名密码验证】
编写一个程序做到添加/验证用户名密码,包含两个函数:
add_user(user_name, pass_word) 不返回任何信息,用于添加一个用户,用户名是user_name,密码是pass_word
verify_user(user_name, pass_word)返回Boolean值(代表用户名密码是否正确),如果存在用户名为user_name,密码为pass_word的用户,则返回True,密码错误或者用户不存在则返回False
如:
add_user("circle", "cat")
print(verify_user("circle","cat"))
print(verify_user("... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def add_user(user_name, pass_word):
user_info[user_name] = pass_word
def verify_user(user_name, pass_word):
if user_name in user_info:
if user_info[user_name] == pass_word:
return True
return... | 6,721 | todo | input_dict = input()
input_dict = eval(input_dict)
use_info={}
def add_user(user_name,pass_word):
user_info[user_name]=pass_word
def verif_user(user_name,pass_word):
if user_name in user_info:
if pass_word==user_info[user_name]:
return True
else:
return Fals... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"258";s:10:"questionid";s:3:"256";s:8:"testtype";s:1:"0";s:8:"... | 35,989 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 16, in <module>
add_user(i[0], i[1])
File "__tester__.python3", line 7, in add_user
user_info[user_name]=pass_word
NameError: name 'user_info' is not defined
" | NameError | No error | No error | NameError | NameError | error |
39,755 | 932 | 字典LAB0.2 | 551 | 提供一个int字典my_dict,若其中含有key为1,3,5,7的项,则将这些项删除。
如:
my_dict = {1:0, 3:1, 5:9, 7:16}
执行完毕后应为:
my_dict = {}
如:
my_dict = {1:7, 5:9, 0:20}
执行完毕后应为:
my_dict = {0:20}
如:
my_dict = {0:20, 2:40, 4:60}
执行完毕后应为:
my_dict = {0:20, 2:40, 4:60}
| input_dict = input()
my_dict = eval(input_dict)
# 请不要更改此行以上的代码
to_delete = [1,3,5,7]
for i in to_delete:
if i in my_dict:
del my_dict[i]
# 请不要更改此行以下的代码
print(my_dict) | 154,266 | todo | input_dict = input()
my_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
if 1 in my_dict:
del my_dict[1]
if 3 in my_dict:
del my_dict[3]
# 请不要更改此行以下的代码
print(my_dict) | 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:4;s:10:"actualmark";d:2;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"609";s:10:"questionid";s:3:"551";s:8:"testtype";s:1:"0";s:8:"... | 644,220 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
48,167 | 2,340 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 183,952 | 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... | 763,637 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
22,678 | 719 | 循环LAB1 | 397 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 62,835 | todo | param = input()
# 在此处编写代码
def reverse_string(param):
a=len(param)
for i in str(param):
a=a-1
if a>1:
print(param[a],end="")
else:
print("")
print(reverse_string(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:97:"Sorry: TabError: inconsistent use of tabs and spaces in indentation (__tester__.python3, line 6)
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist... | 278,809 | 2 | 0 | No error | No error | Sorry: TabError: inconsistent use of tabs and spaces in indentation (__tester__.python3, line 6)
| TabError | TabError | TabError | error |
42,969 | 349 | 递归LAB2.2 | 607 | 请补全fibonacci(num)
| input_int = int(input())
# 请不要更改此行以上的代码
def fibonacci(num):
if num == 0:
return 1
elif num == 1:
return 1
else:
return fibonacci(num-2) + fibonacci(num-1)
# 请不要更改此行以下的代码
print(fibonacci(input_int)) | 164,231 | complete | input_int = int(input())
# 请不要更改此行以上的代码
def fibonacci(num):
if num == 0:
return 1
elif num == 1:
return 1
else:
return fibonacci(num-1) + fibonacci(num-2)
# 请不要更改此行以下的代码
print(fibonacci(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:8;s:10:"actualmark";d:8;s:11:"testresults";a:8:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"681";s:10:"questionid";s:3:"607";s:8:"testtype";s:1:"0";s:8:"... | 687,272 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
5,622 | 217 | 加法 | 326 | 写一行代码,将 功德 (karma) 加一。
如:
karma = 5
则输出
6
| karma = int(input())
karma = karma + 1
print(karma) | 10,768 | 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:"... | 56,091 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
2,051 | 10 | 循环LAB3 | 98 | 编写一个函数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) | 2,930 | todo | param=input('请输入一个字符串:')
def count_spaces_and_commas():
dh = 0
kg = 0
for strs in param:
if strs ==",":
dh+=1
elif strs ==' ':
kg+=1
else:
""
print("有", dh,"个逗号和", kg, "个空格")
count_spaces_and_commas() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:4;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"107";s:10:"questionid";s:2:"98";s:8:"testtype";s:1:"0";s:8:"t... | 16,495 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
15,127 | 477 | 输入和输出 1.11 | 2,928 | 按要求写出代码。
* 要求:
* 打印:
你好
我在吃饭
(注意最后有一个空行)
| print("你好")
print("我在吃饭") | 39,341 | complete | print('你好\n我在吃饭') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2256";s:10:"questionid";s:4:"2928";s:8:"testtype";s:1:"0";s:8... | 177,950 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,020 | 251 | 成员&标识 | 3,418 | 按要求写出代码。
* 要求:
* 已经给出列表my_list。
* 把用户输入的值转换成int存入变量my_guess。
* 如果my_guess在my-list里,打印'猜对了';
* 否则,打印'猜错了'。
例1:
输入:75
输出:猜对了
解释:75在列表中。
例2:
输入:19
输出:猜错了
解释:19不在列表中。
| my_list = [10, 75, 94]
my_guess = int(input())
if my_guess in my_list:
print('猜对了')
else:
print('猜错了') | 33,639 | complete | my_list = [10, 75, 94]
my_guess=int(input())
if my_guess in my_list:
print("猜对了")
else:
print("猜错了")
| O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2395";s:10:"questionid";s:4:"3418";s:8:"testtype";s:1:"0";s:8... | 166,851 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
25,213 | 791 | 判断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) | 69,545 | todo | param = int(input())
def convert_num(param):
if (param>=10):
convert_num=param-10
convert_num | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"418";s:10:"questionid";s:3:"368";s:8:"testtype";s:1:"0";s:8:"... | 308,192 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
46,148 | 2,154 | 定义变量 | 325 | 定义一个叫做 num_students 的变量,并将它的值设置为100. | num_students = 100
print(num_students) | 178,309 | complete | num_students=100
print(num_students) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"369";s:10:"questionid";s:3:"325";s:8:"testtype";s:1:"0";s:8:"... | 741,355 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
19,121 | 723 | 分支 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) | 53,082 | todo | user_age=int(num_candles)
def num_candles():
if((num_candles=='18')
num_candles==18
else:
num_candles==3
print(num_candles) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:91:" File "__tester__.python3", line 4
num_candles==18
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:... | 232,904 | 2 | 0 | No error | No error | File "__tester__.python3", line 4
num_candles==18
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
27,298 | 815 | 范围 3.14 | 3,369 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int,存入cat_age。
* 如果cat_age大于或等于1,并且小于或等于10,打印'可以上飞机';
* 否则,打印'不能上飞机'。
例1:
输入:3
输出:可以上飞机
解释:1 < 3 < 10,所以打印'可以上飞机'。
例2:
输入:12
输出:不能上飞机
解释:12 > 10,所以打印'不能上飞机'。
| cat_age = int(input())
if (1 <= cat_age <= 10):
print('可以上飞机')
else:
print('不能上飞机') | 77,094 | complete | cat_age=int(input())
if (cat_age >= 1) and (cat_age <= 10):
print ('可以上飞机')
else:
print ('不能上飞机') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2390";s:10:"questionid";s:4:"3369";s:8:"testtype";s:1:"0";s:8... | 350,291 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
22,627 | 325 | 循环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) | 62,727 | todo | param = int(input())
def double_until_one_thousand(x):
while(x<=1000):
print "str(x)"
x=x*2
if x>1000:
break
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:96:" File "__tester__.python3", line 5
print "str(x)"
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist"... | 274,819 | 2 | 0 | No error | No error | File "__tester__.python3", line 5
print "str(x)"
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
6,404 | 244 | LAB1.0 | 342 | 补全以下代码,使其打印x被y除三次,并打印每次的结果。
如:
x = 8
y = 2
则输出:
4.0
2.0
1.0
| x = int(input())
y = int(input())
x /= y
print(x)
x /= y
print(x)
x /= y
print(x) | 12,277 | todo | x = int(input())
y = int(input())
# 在此处补全代码
pinrt(float(x/y))
pinrt(float(x/y))
pinrt(float(x/y)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"385";s:10:"questionid";s:3:"342";s:8:"testtype";s:1:"0";s:8:"... | 67,749 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 5, in <module>
pinrt(float(x/y))
NameError: name 'pinrt' is not defined
" | NameError | No error | No error | NameError | NameError | error |
8,800 | 304 | 分支 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) | 19,980 | complete | user_age = int(input())
if user_age == 18:
num_candles = 18
else:
num_candles = 3
print(num_candles) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2425";s:10:"questionid";s:4:"3477";s:8:"testtype";s:1:"0";s:8... | 97,585 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
16,411 | 593 | 列表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)) | 44,118 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
def count_negative(my_list):
count = 0
for i in my_list:
if (i < 0):
count += i
return count
# 请不要更改此行以下的代码
print(count_negative(temp_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"501";s:10:"questionid";s:3:"474";s:8:"testtype";s:1:"0";s:8:"... | 197,500 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 12, in <module>
print(count_negative(temp_list))
File "__tester__.python3", line 8, in count_negative
if (i < 0):
TypeError: '<' not supported between instances of 'str' and 'int'
" | TypeError | No error | No error | TypeError | TypeError | error |
10,868 | 346 | 循环3.1 | 393 | 补全以下代码,打印输入字符串的第5位(有疑问请咨询小组长)。
例如:
输入:"CircleCat"
打印:"l"
| param = input()
print(param[4]) | 26,933 | complete | param = input()
# 在此处补全代码
print(param[4]) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"... | 126,186 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
19,614 | 718 | 输入和输出 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) | 54,693 | complete | a=int(input(''))
b=int(input(''))
print(a+b) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2410";s:10:"questionid";s:4:"3474";s:8:"testtype";s:1:"0";s:8... | 240,444 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
45,002 | 2,085 | 输入和输出 1.11 | 2,928 | 按要求写出代码。
* 要求:
* 打印:
你好
我在吃饭
(注意最后有一个空行)
| print("你好")
print("我在吃饭") | 173,070 | complete | print("你好\n我在吃饭\n") | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2256";s:10:"questionid";s:4:"2928";s:8:"testtype";s:1:"0";s:8... | 720,749 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
12,102 | 415 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 31,339 | complete | test=input()
print(test+" "+"岁")
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... | 141,662 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
44,920 | 2,084 | 循环3.3 | 395 | 请逐位打印一个字符串。
如:
输入:CircleCat
输出
C
i
r
c
l
e
c
a
t
| param = input()
for i in param:
print(i) | 172,918 | todo | param = input()
for i in "param":
print(i) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:4;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"447";s:10:"questionid";s:3:"395";s:8:"testtype";s:1:"0";s:8:"... | 720,447 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
6,353 | 275 | 硬币数 | 2,054 | 补全以下代码,将所有种类硬币的和打印出来。
注:题目中的yuan / jiao是硬币种类的拼音,没有其他含义。
| num_yuan = int(input())
num_jiao = int(input())
num_coins = num_yuan + num_jiao
print(num_coins) | 12,136 | complete | num_yuan = int(input())
num_jiao = int(input())
# 在这里填写代码
10
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... | 61,900 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
7,220 | 226 | 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)) | 13,788 | todo | i = int(input())
def is_leap_year(i):
# 在这里补全代码
if (i % 4 == 0):
if (i % 100 == 0):
return("不是闰年")
elif (i % 100 != 0):
return("是闰年")
elif (i % 4 != 0):
return("不是闰年")
print(is_leap_year(i)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"403";s:10:"questionid";s:3:"348";s:8:"testtype";s:1:"0";s:8:"... | 70,935 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
19,290 | 608 | 列表LAB1 | 542 | 写一个函数replace_element_in_list(),传入三个参数:input_list (string格式的整数列表), num_from (int), num_to (int),
将input_list中所有的num_from换成num_to。
比如:
input_list = ['1','2','3','4','1','2','3','2']
num_from = 2
num_to = 10
执行完毕后,input_list = ['1','10','3','4','1','10','3','10']
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果,直接更改原列表并返回。
| input_list = input().split(',')
num_1 = int(input())
num_2 = int(input())
# 请不要更改此行以上的代码
def replace_element_in_list(input_list, num_from, num_to):
for i in range(0, len(input_list)):
if int(input_list[i]) == num_from:
input_list[i] = str(num_to)
return input_list
# 请不要更改此行以下的代码
print(repl... | 53,523 | todo | input_list = input().split(',')
num_1 = int(input())
num_2 = int(input())
# 请不要更改此行以上的代码
def replace_element_in_list(input_list, num_1, num_2):
for i in range(0, len(input_list)):
if input_list[i] == str(num_1):
input_list[i] = num_2
print(input_list)
# 在这里编写代码
# 请不要更改此行以下的代码
replace_element_i... | 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:"555";s:10:"questionid";s:3:"542";s:8:"testtype";s:1:"0";s:8:"... | 236,906 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
30,783 | 993 | 输入和输出 1.13 | 2,931 | 按要求写出代码。
* 要求:
* 把用户输入的值打印出来。
* 最后有一个空行。
例1:
输入:3
输出:3
例2:
输入:hi
输出:hi
| result = input()
print(result) | 107,218 | complete | a=input()
print(a)
print() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2263";s:10:"questionid";s:4:"2931";s:8:"testtype";s:1:"0";s:8... | 456,107 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
18,026 | 565 | 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) | 49,860 | 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... | 321,199 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
42,268 | 1,362 | 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)) | 162,429 | todo | i = int(input())
def is_leap_year(i):
if (i%4==0 and i%100!=0) or (i%400==0)
print("是闰年")
else:
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:149:" File "__tester__.python3", line 4
if (i%4==0 and i%100!=0) or (i%400==0)
^
SyntaxError: expected ':'
";s:11:"maxpossmark";d:5;s:10:"actualma... | 680,049 | 2 | 0 | No error | No error | File "__tester__.python3", line 4
if (i%4==0 and i%100!=0) or (i%400==0)
^
SyntaxError: expected ':'
| SyntaxError | SyntaxError | SyntaxError | error |
36,232 | 283 | 列表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
# 请不要更改此行以... | 141,627 | 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):
n=len(input_list_1)
m=len(input_list_1[i])
for i in range(n):
for j in range(m):
k=matrix_1[i][j]+matrix_2[i][j]
return k
... | 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:"... | 626,136 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 15, in <module>
print(add_matrix(input_list_1, input_list_2))
File "__tester__.python3", line 7, in add_matrix
m=len(input_list_1[i])
UnboundLocalError: local variable 'i' referenced before assignment
" | UnboundLocalError | No error | No error | UnboundLocalError | UnboundLocalError | error |
7,187 | 253 | 函数1.0 | 402 | 定义一个叫做 WELCOME_TO_CIRLCLE_CAT() 的函数,它的内容是打印以下这句话
"Welcome to circle cat!"
并使用这个函数2次(不包含题目内的一次)。
| def welcome_to_cirlcle_cat():
print("Welcome to circle cat!")
welcome_to_cirlcle_cat()
welcome_to_cirlcle_cat()
# 请不要更改此行以下的代码
welcome_to_cirlcle_cat() | 13,698 | todo | def welcome_to_cirlcle_cat():
print("welcome to circle cat!")
welcome_to_cirlcle_cat()
welcome_to_cirlcle_cat()
# 请不要更改此行以下的代码
welcome_to_cirlcle_cat() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:152:" File "__tester__.python3", line 1
def welcome_to_cirlcle_cat():
^
SyntaxError: invalid character in identifier
";s:11:"maxpossmark";d:1;s:10:"actualm... | 81,126 | 2 | 0 | No error | No error | File "__tester__.python3", line 1
def welcome_to_cirlcle_cat():
^
SyntaxError: invalid character in identifier
| SyntaxError | SyntaxError | SyntaxError | error |
9,047 | 346 | 范围 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('睡觉了') | 20,924 | 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... | 119,872 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
7,130 | 253 | LAB1.0 | 342 | 补全以下代码,使其打印x被y除三次,并打印每次的结果。
如:
x = 8
y = 2
则输出:
4.0
2.0
1.0
| x = int(input())
y = int(input())
x /= y
print(x)
x /= y
print(x)
x /= y
print(x) | 13,309 | complete | x = int(input())
y = int(input())
print(x/y)
print(x/y/y)
print(x/y/y/y) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"385";s:10:"questionid";s:3:"342";s:8:"testtype";s:1:"0";s:8:"... | 69,368 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
36,869 | 1,267 | 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)) | 146,034 | complete | x = int(input())
y = int(input())
z = int(input())
# 在这里补全代码
def smallest_among_three(x,y,z):
return min(x,y,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:"... | 607,734 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.