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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,246 | 296 | 函数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,850 | complete | # 在这里编写代码
def welcome_to_cirlcle_cat():
print("Welcome to circle cat!")
welcome_to_cirlcle_cat()
welcome_to_cirlcle_cat()
# 请不要更改此行以下的代码
welcome_to_cirlcle_cat() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:1;s:10:"actualmark";d:1;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"476";s:10:"questionid";s:3:"402";s:8:"testtype";s:1:"0";s:8:"... | 71,293 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
2,772 | 64 | 字典1.2 | 241 | 请定义两个字典score_dict和status_dict,存储以下三个人的信息,第一项是score,第二项是status:
john: 90,active
jane: 100, active
james: 0, inactive
| test_param = input()
# 请不要更改此行以上的代码
score_dict = {'john':90, 'jane':100, 'james':0}
status_dict = {'john':'active', 'jane':'active', 'james':'inactive'}
# 请不要更改此行以下的代码
print(score_dict[test_param])
print(status_dict[test_param]) | 5,028 | todo | test_param = input()
# 请不要更改此行以上的代码
score_dict={'john':90,'jane':100,'james':0}
status_dict={'john':'active','jane':'active','james':'inactive'}
# 在这里编写代码
my_dict={}
for key in score_dict:
my_dict[key]=[score_dict[key],status_dict[key]]
# 请不要更改此行以下的代码
print(my_dict[test_param]) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:3;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d: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:"186";s:10:"questionid";s:3:"241";s:8:"testtype";s:1:"0";s:8:"... | 25,546 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
42,021 | 1,365 | 列表4.2 | 501 | 请写一个函数sum_of_matrix(),传入一个列表参数my_list,其中有n个长度为m的列表,其中都是格式为string的整数,返回它们的和。
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果。
| line_list = input().split(';')
temp_list = []
for i in line_list:
temp_list.append(i.split(','))
# 请不要更改此行以上的代码
# 在这里编写代码
def sum_of_matrix(my_list):
ret = 0
for i in my_list:
for j in i:
ret += int(j)
return ret
# 请不要更改此行以下的代码
print(sum_of_matrix(temp_list)) | 162,054 | todo | line_list = input().split(';')
temp_list = []
for i in line_list:
temp_list.append(i.split(','))
# 请不要更改此行以上的代码
# 在这里编写代码
def sum_of_matrix(temp_list):
sum_num = 0
for i in range(0, len(temp_list)):
for j in range(0,len(temp_list[i])):
k = temp_list[i][j]
sum_num += ... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d: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:"... | 678,364 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 16, in <module>
print(sum_of_matrix(temp_list))
File "__tester__.python3", line 13, in sum_of_matrix
sum_num += k
TypeError: unsupported operand type(s) for +=: 'int' and 'str'
" | TypeError | No error | No error | TypeError | TypeError | error |
26,186 | 613 | 递归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,... | 71,940 | complete | 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 + ... | 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:"... | 320,444 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
41,956 | 1,365 | 循环3.1 | 393 | 补全以下代码,打印输入字符串的第5位(有疑问请咨询小组长)。
例如:
输入:"CircleCat"
打印:"l"
| param = input()
print(param[4]) | 162,024 | todo | param = input()
# 在此处补全代码
for i in str(param):
if i==I:
print(i) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"439";s:10:"questionid";s:3:"393";s:8:"testtype";s:1:"0";s:8:"... | 678,125 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 5, in <module>
if i==I:
NameError: name 'I' is not defined. Did you mean: 'i'?
" | NameError | No error | No error | NameError | NameError | error |
26,306 | 565 | 分支 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) | 72,557 | todo | num_spiders=int(input())
web_size=1
if num_spiders==10:
web_size=web_size*2
else:
web_size=web_size*3
num_spiders=num_spiders+5
print(num_spiders num_spiders) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:124:" File "__tester__.python3", line 8
print(num_spiders num_spiders)
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults... | 322,776 | 2 | 0 | No error | No error | File "__tester__.python3", line 8
print(num_spiders num_spiders)
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
7,614 | 326 | LAB1.2 | 344 | 运动中消耗的卡路里是以下几项的和 减去75.4991 乘以时间 再除以 8.368:
年龄的0.2757倍 体重的0.03295倍 心率的1.0781倍
补全下列代码,给定了年龄,体重,心率,时间,计算出卡路里的消耗量
| age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
calories_burned = ((age * 0.2757) + (weight * 0.03295) + (heart_rate * 1.0781) - 75.4991) * time / 8.368
print(calories_burned) | 15,409 | todo | age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
# 在此处补全代码
calories_burned = (0.2757*age + 0.03295*weight + 1.0781*heart_rate)-75.499
calories_burned = calories_burned * time
calories_burned = calories_burned/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: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:"390";s:10:"questionid";s:3:"344";s:8:"testtype";s:1:"0";s:8:"... | 78,726 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
36,547 | 812 | 判断debug1 | 368 | 以下有一个函数convert_num, 若输入的内容大于10(包括10),则将其减去10。
代码中有错误,请改正其中的错误。
| param = int(input())
def convert_num(input_num):
if (input_num >= 10):
input_num = input_num - 10
print(input_num)
convert_num(param) | 144,844 | todo | def convert_num(input_num):
if (input_num >= 10):
input_num = input_num - 10
return input_num
else:
return input_num
param = int(input())
print(convert_num(param))
| O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:97:"Sorry: TabError: inconsistent use of tabs and spaces in indentation (__tester__.python3, line 6)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist... | 603,579 | 2 | 0 | No error | No error | Sorry: TabError: inconsistent use of tabs and spaces in indentation (__tester__.python3, line 6)
| TabError | TabError | TabError | error |
18,424 | 380 | 字典LAB0.1 | 550 | 定义一个字典num_to_word,把0-10的数字(int)转换为汉字(str)。
例1:
print(num_to_word[7])
应输出
七
例2:
print(num_to_word[10])
应输出
十
| input_int = int(input())
# 请不要更改此行以上的代码
num_to_word = {1:"一", 2:"二", 3:"三", 4:"四", 5:"五", 6:"六", 7:"七", 8:"八", 9:"九", 10:"十"}
# 请不要更改此行以下的代码
print(num_to_word[input_int]) | 51,687 | complete | input_int = int(input())
# 请不要更改此行以上的代码
num_to_word={0:'零',1:'一',2:'二',3:'三',4:'四',5:'五',6:'六',7:'七',8:'八',9:'九',10:'十'}
# 请不要更改此行以下的代码
print(num_to_word[input_int]) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"604";s:10:"questionid";s:3:"550";s:8:"testtype";s:1:"0";s:8:"... | 227,368 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
434 | 51 | 判断2 | 70 | 定义一个函数get_age_status,
输入年龄,如果在0至18(不含),打印“未成年人”;
如果在18-65(不含),打印“工作中”;
如果在65以上,打印“退休了”。
| param = int(input())
def get_age_status(age):
if age < 18:
return "未成年人"
elif age < 65:
return "工作中"
else:
return "退休了"
print(get_age_status(param)) | 624 | todo | get_age_status = int(input())
if get_age_status < 18 and get_age_status > 0:
print("未成年人")
elif get_age_status >= 18 and get_age_status < 65:
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:72:"Sorry: IndentationError: unexpected indent (__tester__.python3, line 2)
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandboxinfo";a:... | 12,637 | 2 | 0 | No error | No error | Sorry: IndentationError: unexpected indent (__tester__.python3, line 2)
| IndentationError | IndentationError | IndentationError | error |
33,666 | 520 | 范围 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('睡觉了') | 125,938 | 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... | 534,305 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
37,343 | 264 | 循环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)) | 147,236 | complete | param = int(input())
# 在此处编写代码
def count_ones(num0):
count = 0
while num>0:
if num % 10 == 1:
count += 1
num //= 10
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:"... | 612,370 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 12, in <module>
print(count_ones(param))
File "__tester__.python3", line 6, in count_ones
while num>0:
UnboundLocalError: local variable 'num' referenced before assignment
" | UnboundLocalError | No error | No error | UnboundLocalError | UnboundLocalError | error |
25,850 | 771 | 列表3.3 | 476 | 请编写一个函数palindrome(),传入一个列表参数my_list,其中的值都是长度为1的string,返回一个boolean,判断在去掉最后一位和第一位后,该列表是否是回文。
请不要使用任何列表自带函数,也不要创建一个新的列表来储存结果(可以更改原列表的内容)。
| temp_list = input().split(',')
# 请不要更改此行以上的代码
def palindrome(my_list):
my_list.pop()
my_list.remove(my_list[0])
return my_list == my_list[::-1]
# 请不要更改此行以下的代码
print(palindrome(temp_list)) | 70,961 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
def palindrome(my_list):
for i in range(1,len(my_list)-1):
if(my_list[i]==my_list[len(my_list)-i-1]):
return True
esle if(' '):
return True
else:
return False
# 请不要更改此行以下的代码
p... | 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:101:" File "__tester__.python3", line 8
esle if(' '):
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:8;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecod... | 555,543 | 2 | 0 | No error | No error | File "__tester__.python3", line 8
esle if(' '):
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
23,193 | 774 | 列表LAB2 | 543 | 编写一个count_numbers()函数,传入一个参数:input_list (string格式的个位整数),
在此函数中,新建一个10位长的列表,每一位代表input_list内含有此位数的个数,并返回这个列表。
例1:
input_list = ['1', '0', '7', '7', '8', '3']
则返回 [1, 1, 0, 1, 0, 0, 0, 2, 1, 0]
input_list内含1个0,因此返回列表的第0位为1;
内含1个1,因此返回列表的第1位为1;
内含2个7,因此返回列表的第7位为2;
内含1个3,因此返回列表的第3位为1;
内含1个8,因此返回列表的第8位为1。
例2:
inp... | input_list = input().split(',')
# 请不要更改此行以上的代码
def count_numbers(input_list):
res = [0,0,0,0,0,0,0,0,0,0]
for i in input_list:
res[int(i)] += 1
return res
# 请不要更改此行以下的代码
print(count_numbers(input_list)) | 63,808 | todo | input_list = input().split(',')
# 请不要更改此行以上的代码
def count_numbers(input_list):
count_no = [0,0,0,0,0,0,0,0,0,0]
for i in range(0,10):
count_no[int(i)] = count_no[int(i)] + 1
return count_no
# 在这里编写代码
# 请不要更改此行以下的代码
print(count_numbers(input_list)) | 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:6;s:10:"actualmark";d:1;s:11:"testresults";a:6:{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:"... | 289,952 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
13,710 | 461 | 分支1.7 | 3,129 | 按要求写出代码。
* 要求:
* 把用户输入的一个值转换成int并存入变量num_spiders。
* 如果num_spiders不等于15,给变量web_size赋值为20;
* 否则,给变量web_size赋值为num_spiders。
* 最后,无论num_spiders是多少,都把web_size乘2。
* 打印web_size。
例1:
输入:15
输出:30
解释:num_spiders不等于15,所以web_size被赋值为15。最后web_size乘2,所以web_size为30。
例2:
输入:17
输出:40
解释:num_spiders不等于15,所以web_size等于15。最... | num_spiders = int(input())
if num_spiders != 15:
web_size = 20
else:
web_size = num_spiders
web_size = 2 * web_size
print(web_size) | 35,638 | complete | num_spiders=int(input())
if num_spiders != 15:
web_size = 20
else:
web_size = num_spiders
print(web_size*2) | 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:"2330";s:10:"questionid";s:4:"3129";s:8:"testtype";s:1:"0";s:8... | 161,565 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
26,677 | 565 | 判断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) | 74,449 | todo | input_num = int(input())
def convert_num(input_num):
if (input_num >= 10):
input_num = input_num - 10
return input_num
convert_num(input_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:"... | 331,464 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
18,814 | 723 | 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) | 52,338 | todo | print('I can')
print('swim.')
my_age = 10
| O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d: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... | 229,720 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
24,348 | 458 | 循环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) | 66,696 | todo | param = input()
str=str(param)
# 在此处编写代码
def count_spaces_and_commas(param):
count_a=0
count_b=0
for i in str:
if i==",":
count_a +=1
a=str(count_a)
elif i=="":
count_b +=1
b=str(count_b)
print("有"+a+"个逗号和"+b+"个空格")
count_spac... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"464";s:10:"questionid";s:3:"399";s:8:"testtype";s:1:"0";s:8:"... | 305,151 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 15, in <module>
count_spaces_and_commas(param)
File "__tester__.python3", line 10, in count_spaces_and_commas
a=str(count_a)
TypeError: 'str' object is not callable
" | TypeError | No error | No error | TypeError | TypeError | error |
8,931 | 362 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 20,553 | complete | age = str(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:"... | 99,253 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
38,091 | 1,273 | 输入和输出 1.2 | 2,860 | 打印字符串:
I am Python!
| print("I am Python!") | 149,013 | 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... | 621,840 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
1,514 | 15 | 加法 | 30 | 写一行代码,将 功德 (karma) 加一。
如:
karma = 5
则输出
6
| karma = int(input())
karma = karma + 1
print(karma) | 2,214 | todo | karma = int(input())
# 在这里填写代码
kama = kama +1
print(karma) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:2:"15";s:10:"questionid";s:2:"30";s:8:"testtype";s:1:"0";s:8:"te... | 10,629 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 4, in <module>
kama = kama +1
NameError: name 'kama' is not defined
" | NameError | No error | No error | NameError | NameError | error |
36,486 | 364 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 144,516 | todo | print(input()+“岁”)
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:133:" File "__tester__.python3", line 1
print(input()+“岁”)
^
SyntaxError: invalid character in identifier
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresu... | 602,838 | 2 | 0 | No error | No error | File "__tester__.python3", line 1
print(input()+“岁”)
^
SyntaxError: invalid character in identifier
| SyntaxError | SyntaxError | SyntaxError | error |
30,763 | 977 | 字典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) | 107,192 | complete | input_dict = input()
my_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
for i in list(my_dict.keys()):
if i == 1 or i == 3 or i == 5 or i == 7:
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: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:"609";s:10:"questionid";s:3:"551";s:8:"testtype";s:1:"0";s:8:"... | 455,627 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
1,039 | 41 | 判断2 | 70 | 定义一个函数get_age_status,
输入年龄,如果在0至18(不含),打印“未成年人”;
如果在18-65(不含),打印“工作中”;
如果在65以上,打印“退休了”。
| param = int(input())
def get_age_status(age):
if age < 18:
return "未成年人"
elif age < 65:
return "工作中"
else:
return "退休了"
print(get_age_status(param)) | 1,529 | 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:2:"53";s:10:"questionid";s:2:"70";s:8:"testtype";s:1:"0";s:8:"te... | 6,609 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
18,762 | 641 | 输入和输出 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) | 52,283 | todo | a = int(input())
b = int(input())
print('输入:' + str(a),str(b))
print('输出:' +str(a+b))
print('解释:'+ str(a) , '+' ,str(b) , '=' , str(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... | 323,018 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
33,503 | 1,033 | 递归2.3 | 593 | 用递归编写一个函数x_power_of_y(x, y)计算x的y次方。
如x_power_of_y(2, 3) 应返回2的3次方,即8;
x_power_of_y(3, 2) 应返回3的2次方,即9;
x_power_of_y(4, 3) 应返回4的3次方,即64。
| input_x = int(input())
input_y = int(input())
# 请不要更改此行以上的代码
def x_power_of_y(x, y):
if x == 0:
return 0
if y == 0:
return 1
else:
return x * x_power_of_y(x, y - 1)
# 请不要更改此行以下的代码
print(x_power_of_y(input_x, input_y)) | 125,535 | todo | input_x = int(input())
input_y = int(input())
# 请不要更改此行以上的代码
def x_power_of_y(x, y):
if y == 0:
return x
else:
return x * x_power_of_y(x,y-1)
# 请不要更改此行以下的代码
print(x_power_of_y(input_x, input_y)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:3;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:2;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"676";s:10:"questionid";s:3:"593";s:8:"testtype";s:1:"0";s:8:"... | 532,632 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
36,554 | 812 | 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)) | 144,846 | complete | x = int(input())
y = int(input())
z = int(input())
print(min(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:"... | 603,707 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
1,886 | 79 | 循环LAB4 | 99 | 请编写一个函数is_palindrome,判断输入的字符串是否是回文(什么是回文?)
例如:
输入:CircleCat
返回:False
输入: TAT
返回:True
输入:A
返回:True
| param = input()
def is_palindrome(s):
return s == s[::-1]
print(is_palindrome(param)) | 2,729 | complete | param = input()
# 在此处编写代码
def is_palindrome(n):
a = param
b = ''
for i in a:
b = i + b
if a==b:
return True
else:
return False
print(is_palindrome(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:8;s:10:"actualmark";d:8;s:11:"testresults";a:8:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"111";s:10:"questionid";s:2:"99";s:8:"testtype";s:1:"0";s:8:"t... | 14,400 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
19,764 | 153 | 字典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) | 55,373 | todo | input_dict = input()
my_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
if 1 in input_dict:
del input_dict[1]
if 3 in input_dict:
del input_dict[3]
if 5 in input_dict:
del input_dict[5]
if 7 in input_dict:
del input_dict[7]
# 请不要更改此行以下的代码
print(my_dict) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"609";s:10:"questionid";s:3:"551";s:8:"testtype";s:1:"0";s:8:"... | 246,017 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 7, in <module>
if 1 in input_dict:
TypeError: 'in <string>' requires string as left operand, not int
" | TypeError | No error | No error | TypeError | TypeError | error |
21,538 | 701 | 循环3.1 | 393 | 补全以下代码,打印输入字符串的第5位(有疑问请咨询小组长)。
例如:
输入:"CircleCat"
打印:"l"
| param = input()
print(param[4]) | 60,177 | todo | param = input()
def print_fifth_letter(param):
for i in "param":
print(str(i[4]))
print_fifth_letter(param) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:81:"Sorry: IndentationError: expected an indented block (__tester__.python3, line 4)
";s:11:"maxpossmark";d:4;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandbo... | 262,420 | 2 | 0 | No error | No error | Sorry: IndentationError: expected an indented block (__tester__.python3, line 4)
| IndentationError | IndentationError | IndentationError | error |
1,230 | 79 | 循环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) | 1,830 | complete | param = int(input())
# 在此处补全代码
def double_until_one_thousand(n):
while n <= 1000:
print (n)
n = n*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... | 8,628 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
12,975 | 271 | 字典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
# 请不要... | 33,485 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
user_info={}
def add_user(user_name, pass_word):
user_info['add']=[('user_name','pass_word')]
user_info['user_name']='pass_word'
def verify_user(user_name, pass_word):
if 'user_name' in user_info:
... | 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:"... | 157,030 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
22,001 | 596 | 变量和赋值 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) | 61,236 | todo | a = input(num_cats)
b = input(num_dogs)
print(a + b) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2285";s:10:"questionid";s:4:"3018";s:8:"testtype";s:1:"0";s:8... | 298,077 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 1, in <module>
a = input(num_cats)
NameError: name 'num_cats' is not defined
" | NameError | No error | No error | NameError | NameError | error |
28,628 | 871 | 变量和赋值 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) | 84,563 | complete | num_cats=int(input())
num_dogs=int(input())
a=num_cats+num_dogs
print(a)
print() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2285";s:10:"questionid";s:4:"3018";s:8:"testtype";s:1:"0";s:8... | 379,779 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
39,915 | 1,302 | 判断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)) | 154,641 | todo | 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: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:"... | 646,896 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
46,014 | 2,167 | debug类型1 | 339 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 177,744 | 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:"... | 738,566 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
36,746 | 1,253 | 定义变量 | 325 | 定义一个叫做 num_students 的变量,并将它的值设置为100. | num_students = 100
print(num_students) | 145,639 | 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:"... | 606,049 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
29,351 | 282 | 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) | 92,660 | 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:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:122:" File "__tester__.python3", line 1
print('I can")
^
SyntaxError: EOL while scanning string literal
";s:11:"maxpossmark";d:1;s:10:"actualmark";i:0;s:11:"testresults";... | 402,589 | 2 | 0 | No error | No error | File "__tester__.python3", line 1
print('I can")
^
SyntaxError: EOL while scanning string literal
| SyntaxError | SyntaxError | SyntaxError | error |
9,473 | 203 | 变量和赋值 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) | 22,346 | todo | num_cats = int(input())
num_dogs = int(input())
res = num_cats + num_dogs
print(res + '\n') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2285";s:10:"questionid";s:4:"3018";s:8:"testtype";s:1:"0";s:8... | 106,388 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 6, in <module>
print(res + '\n')
TypeError: unsupported operand type(s) for +: 'int' and 'str'
" | TypeError | No error | No error | TypeError | TypeError | error |
26,216 | 842 | 输入和输出 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) | 72,005 | 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... | 321,376 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
48,079 | 2,204 | 字典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... | 183,740 | 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]=user_info[user_name]+1
else:
user_info[user_name]=1
def print_user_log(user_name):
print user_info[user_name]
... | 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:177:" File "__tester__.python3", line 14
print user_info[user_name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
";s:11:"max... | 762,081 | 2 | 0 | No error | No error | File "__tester__.python3", line 14
print user_info[user_name]
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| SyntaxError | SyntaxError | SyntaxError | error |
43,764 | 2,030 | 输入和输出 1.12 | 2,929 | 按要求写出代码。
* 要求:
* 打印:
*
你好
再见
(第一行有七个空格,最后有一个新的空行)
| print(" 你好\n再见") | 168,003 | 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... | 702,506 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
23,567 | 719 | 字典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) | 65,206 | todo | input_dict = input()
my_dict = eval(input_dict)
# 请不要更改此行以上的代码
# 在这里编写代码
del my_dict[1]
del my_dict[3]
del my_dict[5]
del my_dict[7]
# 请不要更改此行以下的代码
print(my_dict) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:1;s:11:"testresults";a:2:{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:"... | 285,073 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 7, in <module>
del my_dict[3]
KeyError: 3
" | KeyError | No error | No error | KeyError | KeyError | error |
15,308 | 382 | 列表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)) | 40,049 | complete | line_list = input().split(';')
temp_list = []
for i in line_list:
temp_list.append(i.split(','))
# 请不要更改此行以上的代码
def sum_of_matrix(temp_list):
a=0
for k in range(0,len(temp_list)):
for j in range(0,len(temp_list[k])):
a+=int(temp_list[k][j])
return a
# 在这里编写代码... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d: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:"534";s:10:"questionid";s:3:"501";s:8:"testtype";s:1:"0";s:8:"... | 182,598 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
31,581 | 1,078 | 输入和输出 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) | 115,235 | todo | one = int(input('3'));
two = int(input('4'));
three = one + two;
print('three'); | 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... | 483,439 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
33,239 | 986 | 输入和输出 1.13 | 2,931 | 按要求写出代码。
* 要求:
* 把用户输入的值打印出来。
* 最后有一个空行。
例1:
输入:3
输出:3
例2:
输入:hi
输出:hi
| result = input()
print(result) | 124,563 | complete | 3
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:"2263";s:10:"questionid";s:4:"2931";s:8:"testtype";s:1:"0";s:8... | 529,491 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
19,208 | 732 | 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) | 53,325 | 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:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:99:" File "__tester__.python3", line 2
print(swim.)
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:1;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodeli... | 237,847 | 2 | 0 | No error | No error | File "__tester__.python3", line 2
print(swim.)
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
11,389 | 296 | 递归2.3 | 593 | 用递归编写一个函数x_power_of_y(x, y)计算x的y次方。
如x_power_of_y(2, 3) 应返回2的3次方,即8;
x_power_of_y(3, 2) 应返回3的2次方,即9;
x_power_of_y(4, 3) 应返回4的3次方,即64。
| input_x = int(input())
input_y = int(input())
# 请不要更改此行以上的代码
def x_power_of_y(x, y):
if x == 0:
return 0
if y == 0:
return 1
else:
return x * x_power_of_y(x, y - 1)
# 请不要更改此行以下的代码
print(x_power_of_y(input_x, input_y)) | 29,018 | complete | input_x = int(input())
input_y = int(input())
# 请不要更改此行以上的代码
def x_power_of_y(x, y):
# 在此补充
if y == 0:
return 1
else:
return x_power_of_y(x,y-1)*x
# 请不要更改此行以下的代码
print(x_power_of_y(input_x, input_y)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"676";s:10:"questionid";s:3:"593";s:8:"testtype";s:1:"0";s:8:"... | 134,473 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
27,339 | 721 | 字典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]
... | 77,520 | complete | input_str = input()
# 请不要更改此行以上的代码
# 在这里编写代码
def get_first_duplicate(input_str):
for i in range(0,len(input_str)):
for j in range(i+1,len(input_str)):
if input_str[j] == input_str[i]:
return input_str[i]
return ''
# 请不要更改此行以下的代码
print(get_first_duplicate(input_str... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"... | 345,309 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
1,561 | 70 | 判断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)) | 2,295 | 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... | 11,306 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
41,897 | 1,365 | 分支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) | 161,841 | complete | num_spiders = int(input())
# web_size = 1
if num_spiders != 15:
web_size = 20
else:
web_size = num_spiders
web_size = web_size * 2
print(web_size) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:... | 677,608 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
43,606 | 917 | 范围 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('不好看')
| 166,580 | todo | user_input = input(x)
film_rate = int(user_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: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:"2340";s:10:"questionid";s:4:"3279";s:8:"testtype";s:1:"0";s:8... | 696,812 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 1, in <module>
user_input = input(x)
NameError: name 'x' is not defined
" | NameError | No error | No error | NameError | NameError | error |
23,359 | 642 | 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) | 64,284 | complete | age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
calories_burned=age*0.2757+weight*0.03295+heart_rate*1.0781-75.4991
calories_burned=calories_burned*time/8.368
print(calories_burned) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:2;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"3178";s:10:"questionid";s:4:"6216";s:8:"testtype";s:1:"0";s:8... | 283,273 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
24,320 | 458 | 循环LAB1 | 397 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 66,694 | todo | param = input()
# 在此处编写代码
def reverse_string(param):
print(param[::-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:4;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"456";s:10:"questionid";s:3:"397";s:8:"testtype";s:1:"0";s:8:"... | 301,103 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
8,190 | 140 | 变量和赋值 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) | 17,248 | todo | num_cats=input()
num_dogs=input()
print(num_cats+num_dogs+'\n') | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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... | 88,542 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
19,151 | 723 | 范围 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('到齐了')
| 53,102 | todo | num_students=int(input())
if(num_syudents<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: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:"2350";s:10:"questionid";s:4:"3281";s:8:"testtype";s:1:"0";s:8... | 235,912 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 2, in <module>
if(num_syudents<50):
NameError: name 'num_syudents' is not defined
" | NameError | No error | No error | NameError | NameError | error |
17,826 | 458 | 硬币数 | 2,054 | 补全以下代码,将所有种类硬币的和打印出来。
注:题目中的yuan / jiao是硬币种类的拼音,没有其他含义。
| num_yuan = int(input())
num_jiao = int(input())
num_coins = num_yuan + num_jiao
print(num_coins) | 49,005 | todo | num_yuan = int(input())
num_jiao = int(input())
# 在这里填写代码
num_coins=num_yuan
num_coins=num_jiao
print(num_coins) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:2;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:0;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"1810";s:10:"questionid";s:4:"2054";s:8:"testtype";s:1:"0";s:8... | 269,122 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
47,161 | 2,257 | 循环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)) | 181,442 | todo | param = int(input())
def count_ones(param):
count=0
for i in str(param):
if i=="1":
count=count+1
print(count)
print(count_ones(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:5;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"451";s:10:"questionid";s:3:"396";s:8:"testtype";s:1:"0";s:8:"... | 752,032 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
8,226 | 312 | 字典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]
... | 17,483 | complete | input_str = input()
# 请不要更改此行以上的代码
def get_first_duplicate(input_str):
my_str = ''
res = ''
for i in input_str:
if i in my_str:
res = res + i
else:
my_str = my_str + i
if res == '':
return res
for i in input_str:
if i in 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:"... | 89,872 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
36,666 | 364 | 块&缩进 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('蜘蛛很少') | 145,263 | complete | num_spiders = int(input())
num_cats = int(input())
if num_spiders > 10 :
if num_cats > num_spiders:
print("猫会吃掉蜘蛛")
elif num_cats<=num_spiders:
print("猫吃不完蜘蛛")
if num_spiders<=10:
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... | 605,507 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
7,593 | 138 | 循环2.3 | 391 | 请完成以下代码,使其打印
1
2
3
5
6
7
(跳过4)
| for i in range(1,8):
if (i == 4):
continue
print(i) | 15,349 | complete | for i in range(1,8):
# 在此处补全代码
while(i == 4):
break
else:
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:"... | 78,593 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
31,025 | 1,026 | 循环LAB1 | 397 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 110,172 | todo | param = str(input())
def reverse_string():
a=str()
for i in param:
a=i+a
print(a)
# 在此处编写代码
print(reverse_string(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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:"456";s:10:"questionid";s:3:"397";s:8:"testtype";s:1:"0";s:8:"... | 468,055 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 10, in <module>
print(reverse_string(param))
TypeError: reverse_string() takes 0 positional arguments but 1 was given
" | TypeError | No error | No error | TypeError | TypeError | error |
31,938 | 1,088 | 输入和输出 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) | 118,599 | 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... | 506,430 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
28,897 | 903 | 分支1.7 | 3,129 | 按要求写出代码。
* 要求:
* 把用户输入的一个值转换成int并存入变量num_spiders。
* 如果num_spiders不等于15,给变量web_size赋值为20;
* 否则,给变量web_size赋值为num_spiders。
* 最后,无论num_spiders是多少,都把web_size乘2。
* 打印web_size。
例1:
输入:15
输出:30
解释:num_spiders不等于15,所以web_size被赋值为15。最后web_size乘2,所以web_size为30。
例2:
输入:17
输出:40
解释:num_spiders不等于15,所以web_size等于15。最... | num_spiders = int(input())
if num_spiders != 15:
web_size = 20
else:
web_size = num_spiders
web_size = 2 * web_size
print(web_size) | 86,623 | 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:"2330";s:10:"questionid";s:4:"3129";s:8:"testtype";s:1:"0";s:8... | 430,123 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
29,556 | 895 | 加法 | 326 | 写一行代码,将 功德 (karma) 加一。
如:
karma = 5
则输出
6
| karma = int(input())
karma = karma + 1
print(karma) | 93,858 | 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:"... | 407,094 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
23,472 | 260 | 循环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) | 64,758 | todo | param = int(input())
# 在此处补全代码
def double_until_one_thousand(param):
while(param < 1000):
print (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:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:4;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2074";s:10:"questionid";s:4:"2432";s:8:"testtype";s:1:"0";s:8... | 284,036 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
3,472 | 15 | 列表LAB2 | 243 | 编写一个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)) | 6,075 | todo | input_list = input().split(',')
# 请不要更改此行以上的代码
# 在这里编写代码
#提取列表里的每一个参数,判断有几个0——10
def count_numbers(input_list):
a=b=c=d=e=f=g=h=i=j=0
for i in range(0,len(input_list)):
if(input_list[i]=='0'):
a+=1
if(input_list[i]=='1'):
b+=1
if(input_list[i]=='2'):
... | 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:6;s:10:"actualmark";d:0;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"189";s:10:"questionid";s:3:"243";s:8:"testtype";s:1:"0";s:8:"... | 29,570 | 1 | 5 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 34, in <module>
print(count_numbers(input_list))
File "__tester__.python3", line 27, in count_numbers
if(input_list[i]=='9'):
IndexError: list index out of range
" | IndexError | No error | No error | IndexError | IndexError | error |
29,572 | 878 | 递归2.2 | 608 | 设计一个函数palindrom(num), 打印以0为中心向两边展开num次,每次递增1的回文。
例如当num = 0, 输出 "0"
例1:
输入: 0
输出: "0"
解释: 输入是0, 不往两边展开.
例2:
输入: 1
输出: "1 0 1"
解释: 输入是1, 往两边展开1次.
例3:
输入: 2
输出: "2 1 0 1 2"
解释: 输入是2, 往两边展开2次.
| input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return "0"
else:
left = str(num) + " "
mid = palindrome(num - 1)
right = " " + str(num)
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int)) | 94,210 | complete | input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return '0'# 在这里补全代码
else:
left = str(num)+' '# 在这里补全代码
mid = palindrome(num-1)
right = ' '+str(num)# 在这里补全代码
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int)... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"689";s:10:"questionid";s:3:"608";s:8:"testtype";s:1:"0";s:8:"... | 409,098 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
33,268 | 1,119 | 范围 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('不好看')
| 124,627 | 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... | 530,015 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
17,123 | 41 | 递归2.2 | 608 | 设计一个函数palindrom(num), 打印以0为中心向两边展开num次,每次递增1的回文。
例如当num = 0, 输出 "0"
例1:
输入: 0
输出: "0"
解释: 输入是0, 不往两边展开.
例2:
输入: 1
输出: "1 0 1"
解释: 输入是1, 往两边展开1次.
例3:
输入: 2
输出: "2 1 0 1 2"
解释: 输入是2, 往两边展开2次.
| input_int = int(input())
# 请不要更改此行以上的代码
def palindrome(num):
if num == 0:
return "0"
else:
left = str(num) + " "
mid = palindrome(num - 1)
right = " " + str(num)
return left + mid + right
# 请不要更改此行以下的代码
print(palindrome(input_int)) | 46,158 | todo | 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)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:4;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:1;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"689";s:10:"questionid";s:3:"608";s:8:"testtype";s:1:"0";s:8:"... | 205,202 | 1 | 4 | No error | No error | No error | No error | No error | LogicError | error |
43,984 | 2,044 | 范围 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('不好看')
| 168,620 | todo | def film_rate(a):
if a > 7:
print("好看")
else:
print("不好看")
film_rate("d")
| 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:"2340";s:10:"questionid";s:4:"3279";s:8:"testtype";s:1:"0";s:8... | 704,913 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 6, in <module>
film_rate("d")
File "__tester__.python3", line 2, in film_rate
if a > 7:
TypeError: '>' not supported between instances of 'str' and 'int'
" | TypeError | No error | No error | TypeError | TypeError | error |
47,756 | 2,271 | 列表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)) | 182,661 | todo | line_list = input().split(';')
temp_list = []
for i in line_list:
temp_list.append(i.split(','))
# 请不要更改此行以上的代码
def sum_of_matrix(my_list):
sum = 0
for i in range(0, len(my_list)):
for j in range(0, len(my_list[i])):
sum += int(j)
return sum
# 在这里编写代码
# 请不... | 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:"534";s:10:"questionid";s:3:"501";s:8:"testtype";s:1:"0";s:8:"... | 762,587 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
958 | 95 | 判断2 | 70 | 定义一个函数get_age_status,
输入年龄,如果在0至18(不含),打印“未成年人”;
如果在18-65(不含),打印“工作中”;
如果在65以上,打印“退休了”。
| param = int(input())
def get_age_status(age):
if age < 18:
return "未成年人"
elif age < 65:
return "工作中"
else:
return "退休了"
print(get_age_status(param)) | 1,393 | complete | param = int(input())
def get_age_status(param):
age = param
if 0<age<18:
return("未成年人")
elif 18<= age < 65:
return("工作中")
else:
return("退休了")
print(get_age_status(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:2:"53";s:10:"questionid";s:2:"70";s:8:"testtype";s:1:"0";s:8:"te... | 6,059 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
15,534 | 553 | 分支 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) | 41,508 | 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... | 186,504 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
16,497 | 413 | 输入和输出 1.13 | 2,931 | 按要求写出代码。
* 要求:
* 把用户输入的值打印出来。
* 最后有一个空行。
例1:
输入:3
输出:3
例2:
输入:hi
输出:hi
| result = input()
print(result) | 44,303 | todo | '输出'=input('3')
print('hi') | 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:105:" File "__tester__.python3", line 1
'输出'=input('3')
^
SyntaxError: cannot assign to literal
";s:11:"maxpossmark";d:5;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecod... | 198,823 | 2 | 0 | No error | No error | File "__tester__.python3", line 1
'输出'=input('3')
^
SyntaxError: cannot assign to literal
| SyntaxError | SyntaxError | SyntaxError | error |
7,128 | 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 | todo | x = int(input())
y = int(input())
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:3;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:0;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"385";s:10:"questionid";s:3:"342";s:8:"testtype";s:1:"0";s:8:"... | 69,345 | 1 | 3 | No error | No error | No error | No error | No error | LogicError | error |
29,834 | 818 | 字典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
# 请不要... | 97,332 | 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):
print(if user_name in user_info and pass_word==user_info[user_name])
# 请不要更改此行以下的代码
for i in input_dict['add... | 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:150:" File "__tester__.python3", line 8
print(if user_name in user_info and pass_word==user_info[user_name])
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:3;s:10:"actualm... | 428,738 | 2 | 0 | No error | No error | File "__tester__.python3", line 8
print(if user_name in user_info and pass_word==user_info[user_name])
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
3,893 | 25 | 字典LAB2 | 258 | 【考勤计数器】
编写一个程序来记录考勤,包含一个函数:
log_user(user_name) 不返回任何信息,记录user_name的一次到课
print_user_log(user_name) 不返回任何信息,打印user_name到课几次
如:
log_user("Circle")
log_user("Circle")
log_user("Cat")
log_user("Circle")
print_user_log("Circle")
print_user_log("Cat")
print_user_log("Flirter")
结果为:
3
1
0
如果没有思路请看下面提示
第̶一̶步̶:̶定̶义... | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
user_info = {}
def log_user(user_name):
if user_name in user_info:
user_info[user_name] += 1
else:
user_info[user_name] = 1
def print_user_log(user_name):
if user_name in user_info:
print(user_in... | 6,762 | todo | input_dict = input()
input_dict = eval(input_dict)
# 请不要更改此行以上的代码
log = {}
def log_user(user_name):
if user_name in log:
log[user_name] += 1
else:
log[user_name] = 0
def print_user_log(user_name):
print(log[user_name])
# 请不要更改此行以下的代码
for i in input_dict['log']:
log_use... | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"266";s:10:"questionid";s:3:"258";s:8:"testtype";s:1:"0";s:8:"... | 35,180 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 19, in <module>
print_user_log(i)
File "__tester__.python3", line 13, in print_user_log
print(log[user_name])
KeyError: 'Flirter'
" | KeyError | No error | No error | KeyError | KeyError | error |
29,228 | 818 | 循环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) | 91,690 | todo | param = input()
def count_spaces_and_commas(param):
x=0
y=0
for i in str(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:1;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:0;s:11:"testresults";a:1:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"464";s:10:"questionid";s:3:"399";s:8:"testtype";s:1:"0";s:8:"... | 401,829 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 10, in <module>
print("有"+str(x)+"个逗号"+str(y)+"个空格")
NameError: name 'x' is not defined
" | NameError | No error | No error | NameError | NameError | error |
1,048 | 26 | debug类型1 | 43 | 请改正以下代码中的错误
| age = int(input())
print("my age is " + str(age)) | 1,546 | todo | age = int(input())
print("my age is" + str(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:2:"22";s:10:"questionid";s:2:"43";s:8:"testtype";s:1:"0";s:8:"te... | 6,714 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
6,429 | 280 | 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,295 | complete | x = int(input())
y = int(input())
# 在此处补全代码
x = x / y
print(x)
x = x / y
print(x)
x = x / y
print(x) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:3;s:10:"actualmark";d:3;s:11:"testresults";a:3:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"385";s:10:"questionid";s:3:"342";s:8:"testtype";s:1:"0";s:8:"... | 62,817 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
22,169 | 786 | 输入和输出 1.2 | 2,860 | 打印字符串:
I am Python!
| print("I am Python!") | 61,569 | 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... | 269,320 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
35,284 | 1,211 | 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) | 137,415 | 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... | 577,968 | 1 | 1 | ***运行错误***
Traceback (most recent call last):
File "__tester__.python3", line 4, in <module>
print('my age:'+ my_age)
TypeError: can only concatenate str (not "int") to str
" | TypeError | No error | No error | TypeError | TypeError | error |
15,578 | 485 | 定义变量 | 325 | 定义一个叫做 num_students 的变量,并将它的值设置为100. | num_students = 100
print(num_students) | 41,816 | todo | num_students=100 | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:72:"Sorry: IndentationError: unexpected indent (__tester__.python3, line 1)
";s:11:"maxpossmark";d:1;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourcecodelist";N;s:11:"sandboxinfo";a:... | 187,082 | 2 | 0 | No error | No error | Sorry: IndentationError: unexpected indent (__tester__.python3, line 1)
| IndentationError | IndentationError | IndentationError | error |
44,619 | 2,084 | 输入和输出 1.3 | 2,862 | 打印三行字面字符串:
00000
0 0 0
00000
| print("00000")
print("0 0 0")
print("00000") | 172,265 | 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... | 717,629 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
36,625 | 1,104 | 列表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)) | 145,110 | todo | my_list = input().split(',')
new_list = []
i=0
while i <len(my_list):
val=my_list.pop()
new_list.append(val)
i=i+1
print(",".join(new_list)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s: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... | 605,403 | 2 | 0 | No error | No error | Sorry: TabError: inconsistent use of tabs and spaces in indentation (__tester__.python3, line 6)
| TabError | TabError | TabError | error |
34,962 | 283 | 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) | 134,691 | todo | x = int(input())
y = int(input())
one=int(x/y)
two=int(one/y)
three=int(two/y)
print(float(one))
print(float(two))
print(float(three))
# 在此处补全代码 | 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:"385";s:10:"questionid";s:3:"342";s:8:"testtype";s:1:"0";s:8:"... | 567,941 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
37,057 | 364 | 循环3.3 | 395 | 请逐位打印一个字符串。
如:
输入:CircleCat
输出
C
i
r
c
l
e
c
a
t
| param = input()
for i in param:
print(i) | 146,265 | complete | param = input()
for i in (param):
print(i) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:4;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:3:"447";s:10:"questionid";s:3:"395";s:8:"testtype";s:1:"0";s:8:"... | 608,856 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
31,399 | 1,054 | 输入和输出 1.14 | 2,933 | 按要求写出代码。
* 要求:
* 把用户输入的值后面加一个空格和一个字符串"岁"并打印。
* 最后有一个空行。
例1:
输入:8
输出:8 岁
例2:
输入:12
输出:12 岁
| temp = input()
print(temp,"岁") | 113,888 | complete | num=input()
print(num,"岁")
print() | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i: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... | 478,523 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
11,842 | 400 | 输入和输出 1.11 | 2,928 | 按要求写出代码。
* 要求:
* 打印:
你好
我在吃饭
(注意最后有一个空行)
| print("你好")
print("我在吃饭") | 30,399 | 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:"2256";s:10:"questionid";s:4:"2928";s:8:"testtype";s:1:"0";s:8... | 155,638 | 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 |
20,907 | 640 | 字典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]) | 58,806 | todo | test_param = input()
# 请不要更改此行以上的代码
score_dict={'john':90,'jane':100,'jame':0}
status_dict={'john':'active','jane':'active','jame':'inactive'
# 请不要更改此行以下的代码
print(score_dict[test_param])
print(status_dict[test_param]) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:2;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:105:" File "__tester__.python3", line 8
print(score_dict[test_param])
^
SyntaxError: invalid syntax
";s:11:"maxpossmark";d:3;s:10:"actualmark";i:0;s:11:"testresults";a:0:{}s:14:"sourc... | 295,995 | 2 | 0 | No error | No error | File "__tester__.python3", line 8
print(score_dict[test_param])
^
SyntaxError: invalid syntax
| SyntaxError | SyntaxError | SyntaxError | error |
28,504 | 692 | 列表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)) | 84,017 | complete | input_int = int(input())
input_int_2 = int(input())
input_int_3 = int(input())
# 请不要更改此行以上的代码
def create_matrix(input_int, input_int_2, input_int_3):
list=[]
new_list=[]
for i in range(input_int_2):
list.append(input_int_3)
for y in range(input_int):
new_list.append(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:"599";s:10:"questionid";s:3:"549";s:8:"testtype";s:1:"0";s:8:"... | 377,717 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
47,706 | 2,326 | 变量和赋值 3.6 | 3,020 | 按要求写出代码。
* 要求:
* 把用户输入的值转换成int并乘3。
* 打印出新的值,并创建一个新的空行。
例1:
输入:1
输出:3
解释:1 * 3 = 3
例2:
输入:5
输出:15
解释:5 * 3 = 15
| my_val = int(input())
my_val = my_val * 3
print(my_val) | 182,600 | complete | a = input()
b = int(a)*3
print (b)
print () | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:5;s:10:"actualmark";d:5;s:11:"testresults";a:5:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"2295";s:10:"questionid";s:4:"3020";s:8:"testtype";s:1:"0";s:8... | 761,302 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
30,450 | 948 | 输入和输出 1.2 | 2,860 | 打印字符串:
I am Python!
| print("I am Python!") | 104,420 | 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... | 446,593 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
26,886 | 841 | 列表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)) | 75,277 | todo | temp_list = input().split(',')
# 请不要更改此行以上的代码
def get_max(temp_list):
if (len(temp_list)==1):
print (int(temp_list[0]))
else:
max_num=int(temp_list[0])
for i in temp_list:
i=int(i)
if (max_num<i):
max_num=i
print(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: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:"492";s:10:"questionid";s:3:"472";s:8:"testtype";s:1:"0";s:8:"... | 345,227 | 1 | 2 | No error | No error | No error | No error | No error | LogicError | error |
29,272 | 20 | 输入和输出 1.10 | 2,925 | 按要求写出代码。
* 要求:
* 打印:"生日快乐!"(不打印引号)
| print("生日快乐!") | 92,410 | 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... | 401,545 | 1 | 1 | No error | No error | No error | No error | No error | LogicError | error |
767 | 7 | 循环LAB1 | 96 | 编写一个函数reverse_string,返回输入的字符串倒过来的值。
如:
输入: CircleCat
返回: taCelcriC
| param = input()
def reverse_string(str):
str = str[::-1]
return str
print(reverse_string(param)) | 1,009 | complete | param = input()
# 在此处编写代码
def reverse_string(word):
reverse = ''
for i in range(-1, -len(word)-1,-1):
reverse += word[i]
return reverse
print(reverse_string(param)) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:4;s:10:"actualmark";d:4;s:11:"testresults";a:4:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:2:"99";s:10:"questionid";s:2:"96";s:8:"testtype";s:1:"0";s:8:"te... | 9,360 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
13,577 | 429 | 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) | 35,258 | complete | age = int(input())
weight = int(input())
heart_rate = int(input())
time = int(int(input()))
calories_burned = (age * 0.2757 + weight * 0.03295 + heart_rate * 1.0781 - 75.4991) * time / 8.368
print(calories_burned) | O:32:"qtype_coderunner_testing_outcome":11:{s:6:"status";i:1;s:10:"isprecheck";b:0;s:10:"errorcount";i:0;s:12:"errormessage";s:0:"";s:11:"maxpossmark";d:2;s:10:"actualmark";d:2;s:11:"testresults";a:2:{i:0;O:28:"qtype_coderunner_test_result":14:{s:2:"id";s:4:"3178";s:10:"questionid";s:4:"6216";s:8:"testtype";s:1:"0";s:8... | 160,046 | 1 | 0 | No error | No error | No error | No error | No error | No error | no_error |
10,798 | 178 | 变量和赋值 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) | 26,561 | todo | num_cats=input()
num_dogs=input()
total=num_cats+num_dogs
print(total) | 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... | 123,276 | 1 | 5 | No error | No error | No error | No error | No error | LogicError | error |
43,430 | 1,437 | 字典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
# 请不要... | 165,933 | complete | 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):
return str(user_name) in user_info
# 请不要更改此行以下的代码
for i in input_dict['add']:
add_user(i[0], i[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: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:"... | 694,650 | 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.