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
|
---|---|---|---|---|---|---|---|---|
8,867 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
1,624 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
35,701 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
15,348 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
34,401 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
27,154 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
22,929 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
26,973 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
17,649 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
30,720 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
37,182 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
35,349 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
21,652 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
36,105 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
25,063 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
31,583 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
17,100 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
15,679 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
19,420 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
18,804 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
11,603 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
42,042 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
21,322 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
10,700 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
1,570 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
161 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
13,655 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
11,378 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
29,809 | def fibonacci(n):
if n == 0:
return 0
elif n == 1:
return 1
else:
return fibonacci(n - 1) + fibonacci(n - 2) | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | false | 52070898-b2dd-4882-a9a9-65bd9d55725a | 2,016 |
27,418 | def fibonacci(n):
if n == 0:
return 0
elif n == 1:
return 1
else:
return fibonacci(n - 1) + fibonacci(n - 2) | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | false | 52070898-b2dd-4882-a9a9-65bd9d55725a | 2,016 |
7,715 | def index(str, letter):
i = 0
if letter in str:
c = letter[0]
for ch in str:
if ch == c:
if str[i:i + len(letter)] == letter:
return i
i += 1
return -1 | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | true | 52070898-b2dd-4882-a9a9-65bd9d55725a | 2,016 |
17,032 | def search(str, letter):
for item in str:
if item == letter:
return True
return False | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 52070898-b2dd-4882-a9a9-65bd9d55725a | 2,016 |
20,244 | def index(str, letter):
i = 0
if letter in str:
c = letter[0]
for ch in str:
if ch == c:
if str[i:i + len(letter)] == letter:
return i
i += 1
return -1 | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | true | 52070898-b2dd-4882-a9a9-65bd9d55725a | 2,016 |
10,517 | def search(str, letter):
for item in str:
if item == letter:
return True
return False | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 52070898-b2dd-4882-a9a9-65bd9d55725a | 2,016 |
17,401 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
11,103 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
35,308 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
12,968 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
4,250 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
32,832 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
34,260 | def fibonacci(n):
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
print(a) | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
6,307 | def index(str, letter):
if letter in str:
print(str.index(letter))
else:
print(-1) | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
16,643 | def search(str, letter):
if letter in str:
print(True)
else:
print(False) | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
30,752 | def search(str, letter):
if letter in str:
print(True)
else:
print(False) | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
12,087 | def fibonacci(n):
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
print(a) | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
7,326 | def index(str, letter):
if letter in str:
print(str.index(letter))
else:
print(-1) | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
41,821 | def fibonacci(n):
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
41,561 | def search(s, letter):
if letter in s:
print(True)
else:
print(False) | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
39,777 | def index(s, letter):
if letter in s:
print(str.index(letter))
else:
print(-1) | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
32,063 | def fibonacci(n):
a = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
return a[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | false | 8ed5ee6f-d6e7-4caf-8917-36bbe373ffac | 2,016 |
5,414 | def search(str, letter):
for item in str:
if item == letter:
return True
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 8ed5ee6f-d6e7-4caf-8917-36bbe373ffac | 2,016 |
26,957 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i = i + 1
return '-1' | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 8ed5ee6f-d6e7-4caf-8917-36bbe373ffac | 2,016 |
14,757 | def search(s, letter):
if letter in s:
print(True)
else:
print(False) | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
14,366 | def index(s, letter):
if letter in s:
print(s.index(letter))
else:
print(-1) | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
139 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
31,963 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
else:
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
40,751 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
33,984 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
36,792 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
32,977 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
19,515 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
19,511 | def index(s, letter):
if letter in s:
print(s.index(letter))
else:
print(-1) | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
16,982 | def search(s, letter):
print(letter in s) | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
11,544 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
27,673 | def search(s, letter):
return letter in s | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
12,334 | def index(s, letter):
if letter in s:
print(s.index(letter))
else:
print(-1) | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
4,034 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
16,069 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
7,751 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
14,309 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
3,432 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
32,269 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
29,695 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
4,085 | def index(s, letter):
if letter in s:
return s.index(letter)
else:
return -1 | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
2,013 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
822 | def search(s, letter):
return letter in s | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
14,182 | def index(s, letter):
if letter in s:
return s.index(letter)
else:
return -1 | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
15,680 | def search(s, letter):
return letter in s | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
29,401 | def search(s, letter):
return letter in s | search_iter | search | Iteratively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
3,727 | def index(s, letter):
if letter in s:
return s.index(letter)
else:
return -1 | index_iter | index | Iteratively search for the position of letter in str, return -1 if it is not there. | assert index('','0')==-1 and index('0','0')==0 and index('11','1')==0 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
32,129 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
25,711 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_iter | fibonacci | Iteratively compute the value of the fibonacci series at position n. | assert fibonacci(1)==1 and fibonacci(41)==165580141 and fibonacci(3)==2 and fibonacci(91)==4660046610375530309 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
28,728 | def search(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return True
i += 1
return False | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
24,836 | def index(str, letter):
i = 0
while i < len(str):
if str[i] == letter:
return i
i += 1
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
27,088 | def fibonacci(n):
fib = [0, 1, 1]
for f in range(2, n):
fib.append(fib[-1] + fib[-2])
return fib[n] | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | 3db8d602-4800-4b13-9482-3fb9643a4588 | 2,016 |
22,129 | def search(s, letter):
return letter in s | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
20,348 | def index(s, letter):
if letter in s:
return s.index(letter)
else:
return -1 | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
29,813 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
17,181 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
11,849 | def index(s, letter, num):
if num == len(s):
print(-1)
return
if s[num] == letter:
print(num)
return
index(s, letter, num + 1) | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
32,751 | def search(s, letter):
return letter in s | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
23,340 | def search(s, letter):
return letter in s | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
28,407 | def index(s, letter, num):
if num == len(s):
return -1
if s[num] == letter:
return num
index(s, letter, num + 1) | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
25,839 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
25,954 | def index(s, letter, num):
if num == len(s):
return -1
if s[num] == letter:
return num
index(s, letter, num + 1) | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | false | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
27,014 | def search(s, letter):
return letter in s | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
35,259 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
24,071 | def index(s, letter, num):
if num == len(s):
return -1
if s[num] == letter:
return num
n = index(s, letter, num + 1)
return n | index_recur | index | Recursively search for the position of letter in str, return -1 if it is not there. | assert index('','0',0)==-1 and index('0','0',0)==0 and index('a','8',0)==-1 and index('tV2','2',0)==2 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
19,133 | def fibonacci(n):
if n == 0:
return 0
a, b = 1, 1
for i in range(n - 1):
a, b = b, a + b
return a | fibonacci_recur | fibonacci | Recursively compute the value of the fibonacci series at position n. | assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657 | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
29,867 | def search(s, letter):
return letter in s | search_recur | search | Recursively search for a letter in a string | assert search('','0')==False and search('0','0')==True and search('ERFE0Rfsef','0')==True and search('ERFERfsef0','0')==True and search('','a')==False and search('cbzeycuzbvyzuvb','a')==False and search('cbsducsvdbcyts','c')==True and search('dbzeducvbzy','y')==True and search('xqvsgxcutvy','u')==True | true | aaa0b462-c89e-49f8-8886-ec2961496a19 | 2,016 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.