submission_id
int32 10
42.5k
| func_code
stringlengths 22
782
| assignment_id
stringlengths 4
23
| func_name
stringlengths 4
23
| description
stringlengths 26
128
| test
stringlengths 45
1.22k
| correct
bool 2
classes | user
stringlengths 36
36
| academic_year
int32 2.02k
2.02k
|
---|---|---|---|---|---|---|---|---|
35,515 |
def square_perimeter(r):
return 4 * r
|
square_perimeter
|
square_perimeter
|
Returns the perimeter of a square.
|
assert square_perimeter(0)==0 and square_perimeter(-12684)==-50736
| true |
662f087e-9c5b-47c6-8644-ba7525600aac
| 2,016 |
20,247 |
def rectangle_perimeter(x, y):
return 2 * x + 2 * y
|
rectangle_perimeter
|
rectangle_perimeter
|
Return the perimeter of a rectangle with the given coordinates.
|
assert rectangle_perimeter(0,0)==0 and rectangle_perimeter(7968917888512863576,-18677)==15937835777025689798
| true |
662f087e-9c5b-47c6-8644-ba7525600aac
| 2,016 |
5,504 |
def circle_area(r):
return r * r * 3.14
|
circle_area
|
circle_area
|
Return the area of a circle.
|
assert circle_area(0)==0.0 and circle_area(-1160877629)==4.231579770269758e+18
| true |
662f087e-9c5b-47c6-8644-ba7525600aac
| 2,016 |
4,274 |
def reverse(test):
b = []
i = 0
while i < len(test):
b.append(test[len(test) - 1 - i])
i = i + 1
return b
|
reverse_iter
|
reverse
|
Iteratively reverse a list of elements.
|
assert reverse([])==[] and reverse([20, 10, 0, -10, -20])==[-20, -10, 0, 10, 20] and reverse(['toto', True, [10, 0, 9], 12.8, 6])==[6, 12.8, [10, 0, 9], True, 'toto']
| true |
662f087e-9c5b-47c6-8644-ba7525600aac
| 2,016 |
16,458 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
df8dd1dd-a7c8-46c0-b89f-ec170a81f08a
| 2,016 |
11,055 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
df8dd1dd-a7c8-46c0-b89f-ec170a81f08a
| 2,016 |
32,531 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
df8dd1dd-a7c8-46c0-b89f-ec170a81f08a
| 2,016 |
26,006 |
def reverse(a):
i = 0
while i < len(a) / 2:
j = len(a) - 1 - i
t = a[i]
a[i] = a[j]
a[j] = t
i = i + 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
df8dd1dd-a7c8-46c0-b89f-ec170a81f08a
| 2,016 |
34,701 |
def swap(a, i, j):
tmp = a[j]
a[j] = a[i]
a[i] = tmp
def find_smallest_position(a, i):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
return p
def selection_sort(a):
i = 0
while i < len(a):
p = find_smallest_position(a, i)
swap(a, i, p)
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
df8dd1dd-a7c8-46c0-b89f-ec170a81f08a
| 2,016 |
13,209 |
def swap(a, i, j):
tmp = a[j]
a[j] = a[i]
a[i] = tmp
def find_smallest_position(a, i):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
return p
def selection_sort(a):
i = 0
while i < len(a):
p = find_smallest_position(a, i)
swap(a, i, p)
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
df8dd1dd-a7c8-46c0-b89f-ec170a81f08a
| 2,016 |
2,550 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
bd03ecd6-cea3-4854-803a-b14d429489a7
| 2,016 |
8,611 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
652b3384-e559-46c5-81db-1bf2117db63b
| 2,016 |
24,217 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
99a8a900-efcf-4a9e-86ba-fdd0df4312d3
| 2,016 |
32,360 |
def double(n):
return n + n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
6cbd9686-8a3c-4d12-8a1a-70c661732027
| 2,016 |
15,578 |
def double(x):
y = x * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
2b99bb5a-b2e4-4bc1-b1ae-ecb59c74bd22
| 2,016 |
18,311 |
def double(n):
y = n * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
c0bd18cc-b8fa-4b4a-87c2-5e1043d7ff6c
| 2,016 |
6,420 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
daaef1e8-1fe4-4dc4-b002-6e89fad22a66
| 2,016 |
36,018 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
573bd795-e55d-4f35-83cb-b4c309fb0d57
| 2,016 |
1,788 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
6a42703e-da42-4824-8b83-b6f291ad71be
| 2,016 |
38,787 |
def double(n):
return n + n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
fa2c47e6-9c25-4040-9985-e5ab62711be6
| 2,016 |
196 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
f1c26f39-fb4c-4010-aaa3-142fb52f57b9
| 2,016 |
16,568 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
dc42d7ae-53d0-4b49-988b-c619edf38a77
| 2,016 |
15,114 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
88e97329-9c3f-4e1a-8643-1311f4e801a9
| 2,016 |
17,530 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
ac1dec5e-a5eb-4183-ba72-3b639e82db3c
| 2,016 |
36,220 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
ac1dec5e-a5eb-4183-ba72-3b639e82db3c
| 2,016 |
26,644 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
91bbbbbf-cad8-4507-9c4d-c7cfe0ebc210
| 2,016 |
1,012 |
def circumference(r):
y = 2 * pi * r
return y
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
2b99bb5a-b2e4-4bc1-b1ae-ecb59c74bd22
| 2,016 |
3,827 |
def area(r):
y = pi * r * r
return y
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
2b99bb5a-b2e4-4bc1-b1ae-ecb59c74bd22
| 2,016 |
32,009 |
def double(x):
return x * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
66e06699-d10a-47f1-a343-55edd72e95d2
| 2,016 |
38,919 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
b0c92748-3b02-4340-a9d8-2ebe9a693531
| 2,016 |
36,802 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
daaef1e8-1fe4-4dc4-b002-6e89fad22a66
| 2,016 |
31,379 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
daaef1e8-1fe4-4dc4-b002-6e89fad22a66
| 2,016 |
15,092 |
def circumference(r):
y = 2 * pi * r
return y
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
c0bd18cc-b8fa-4b4a-87c2-5e1043d7ff6c
| 2,016 |
18,309 |
def area(r):
y = pi * r * r
return y
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
c0bd18cc-b8fa-4b4a-87c2-5e1043d7ff6c
| 2,016 |
39,058 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
c0a5d565-4fbf-4274-85af-71162f38b8d4
| 2,016 |
27,478 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
422fe752-ca84-4537-b250-7de556e6ee94
| 2,016 |
25,611 |
def double(x):
y = x * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
621f49f9-6d90-49c2-ada6-2cb48080552a
| 2,016 |
42,230 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
4788f2f7-8b97-41a8-88ee-697183f85246
| 2,016 |
25,778 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
6a42703e-da42-4824-8b83-b6f291ad71be
| 2,016 |
21,843 |
def area(r):
return pi * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
6a42703e-da42-4824-8b83-b6f291ad71be
| 2,016 |
27,841 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
ac1dec5e-a5eb-4183-ba72-3b639e82db3c
| 2,016 |
25,298 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
dc42d7ae-53d0-4b49-988b-c619edf38a77
| 2,016 |
21,898 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
dc42d7ae-53d0-4b49-988b-c619edf38a77
| 2,016 |
42,130 |
def circumference(r):
return 2 * 3.141 * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| true |
bd03ecd6-cea3-4854-803a-b14d429489a7
| 2,016 |
15,687 |
def area(r):
return 3.141 * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| true |
bd03ecd6-cea3-4854-803a-b14d429489a7
| 2,016 |
38,409 |
def area(r):
return pi * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
99a8a900-efcf-4a9e-86ba-fdd0df4312d3
| 2,016 |
26,115 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
99a8a900-efcf-4a9e-86ba-fdd0df4312d3
| 2,016 |
12,534 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
431d0ef6-9edd-464b-a5fa-cccf8b152f4e
| 2,016 |
24,065 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
e8eb24cb-1a57-439b-8705-aed3cec25793
| 2,016 |
25,739 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
8d8fa15f-3f0d-4a69-849b-9b7da96123cd
| 2,016 |
27,296 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
ba8a7560-aac9-45ef-b6fd-730b60e73e8c
| 2,016 |
35,272 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
17658437-97b1-4a8a-ac6f-a63a54536e33
| 2,016 |
13,512 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
17658437-97b1-4a8a-ac6f-a63a54536e33
| 2,016 |
28,690 |
def double(x):
return 2 * x
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
b13f3dba-a06b-4528-a4d8-c2ee1a5bb34d
| 2,016 |
3,188 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
2eb2f93d-3491-4b0b-bad9-894c90595058
| 2,016 |
4,858 |
def double(n):
y = n * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
f69c7616-4d20-4dbe-b3f8-0d10db7adfe4
| 2,016 |
13,143 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
f5dc8223-cf9e-429f-aae8-350d82da1982
| 2,016 |
27,333 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
573bd795-e55d-4f35-83cb-b4c309fb0d57
| 2,016 |
25,583 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
573bd795-e55d-4f35-83cb-b4c309fb0d57
| 2,016 |
38,281 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
72de96bc-40bc-48ca-b1c3-91150748b31a
| 2,016 |
29,232 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
9675c8b9-337a-4fd1-bb8f-8e3510c7f703
| 2,016 |
39,955 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
66e06699-d10a-47f1-a343-55edd72e95d2
| 2,016 |
8,192 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
66e06699-d10a-47f1-a343-55edd72e95d2
| 2,016 |
39,220 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
e84cb3e0-5b98-4543-816e-a3570ba72e05
| 2,016 |
1,211 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
fa2c47e6-9c25-4040-9985-e5ab62711be6
| 2,016 |
25,504 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
fa2c47e6-9c25-4040-9985-e5ab62711be6
| 2,016 |
4,430 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
a49f3af8-fb92-43d5-945c-abc11916e319
| 2,016 |
38,312 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
45fe5d71-35bd-4b87-b28c-71b204939543
| 2,016 |
41,569 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
11fcbbcf-716f-4e92-ab7c-407d4712c9e8
| 2,016 |
28,130 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
6cbd9686-8a3c-4d12-8a1a-70c661732027
| 2,016 |
4,108 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
6cbd9686-8a3c-4d12-8a1a-70c661732027
| 2,016 |
17,248 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
88e97329-9c3f-4e1a-8643-1311f4e801a9
| 2,016 |
26,874 |
def area(r):
return pi * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
88e97329-9c3f-4e1a-8643-1311f4e801a9
| 2,016 |
3,848 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
a58f503b-2a5d-430c-aea3-11134a0daeb8
| 2,016 |
33,355 |
def double(x):
y = x * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
54b87e3d-5711-4a83-a6d1-ed14ae588835
| 2,016 |
30,685 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
5cf0f5b5-a91e-4c33-8ac1-92aa868cd3b0
| 2,016 |
2,621 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
7b8e2d7b-1f3a-4e34-b02c-e6ac46baa465
| 2,016 |
15,085 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
93426de2-87e4-4c00-9910-de51627bd576
| 2,016 |
23,895 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
e8eb24cb-1a57-439b-8705-aed3cec25793
| 2,016 |
8,206 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
e8eb24cb-1a57-439b-8705-aed3cec25793
| 2,016 |
38,795 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
f56d6cc3-92a7-49e7-aa07-2e1c83caaabe
| 2,016 |
6,713 |
def area(r):
a = pi * r * r
return a
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
c0a5d565-4fbf-4274-85af-71162f38b8d4
| 2,016 |
13,261 |
def circumference(r):
c = 2 * pi * r
return c
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
c0a5d565-4fbf-4274-85af-71162f38b8d4
| 2,016 |
3,430 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
f463a026-5eb4-4a39-a858-3a798215a4ee
| 2,016 |
39,734 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
b0c92748-3b02-4340-a9d8-2ebe9a693531
| 2,016 |
37,355 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
b0c92748-3b02-4340-a9d8-2ebe9a693531
| 2,016 |
13,785 |
def area(r):
return pi * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
422fe752-ca84-4537-b250-7de556e6ee94
| 2,016 |
15,923 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
422fe752-ca84-4537-b250-7de556e6ee94
| 2,016 |
39,689 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
ba8a7560-aac9-45ef-b6fd-730b60e73e8c
| 2,016 |
38,203 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
ba8a7560-aac9-45ef-b6fd-730b60e73e8c
| 2,016 |
35,987 |
def area(r):
return PI * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
91bbbbbf-cad8-4507-9c4d-c7cfe0ebc210
| 2,016 |
4,155 |
def circumference(r):
return 2 * PI * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
91bbbbbf-cad8-4507-9c4d-c7cfe0ebc210
| 2,016 |
18,050 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
for i in range(len(a) / 2):
swap(a, i, len(a) - i - 1)
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
91bbbbbf-cad8-4507-9c4d-c7cfe0ebc210
| 2,016 |
24,598 |
def area(r):
return r ** 2 * pi
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
a49f3af8-fb92-43d5-945c-abc11916e319
| 2,016 |
30,294 |
def circumference(r):
return 2 * r * pi
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
a49f3af8-fb92-43d5-945c-abc11916e319
| 2,016 |
34,785 |
def circumference(x):
y = 2 * pi * x
return y
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
54b87e3d-5711-4a83-a6d1-ed14ae588835
| 2,016 |
23,647 |
def area(x):
y = pi * x * x
return y
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
54b87e3d-5711-4a83-a6d1-ed14ae588835
| 2,016 |
39,460 |
def double(x):
y = x * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
f98e9d61-9e86-4fed-86db-3cf718c5962d
| 2,016 |
13,205 |
def double(x):
return 2 * x
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
f6343d5f-9ee0-441c-a67c-781ee180947e
| 2,016 |
32,474 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
431d0ef6-9edd-464b-a5fa-cccf8b152f4e
| 2,016 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.