code
stringlengths
14
580
varname
stringlengths
1
25
vartype
stringclasses
13 values
n = 100 sum_to_n = sum(range(n + 1))
sum_to_n
int
brackets = "()" depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 0: correct_bracketing = False correct_bracketing = depth == 0
b
str
brackets = "()" depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 0: correct_bracketing = False correct_bracketing = depth == 0
brackets
str
brackets = "()" depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 0: correct_bracketing = False correct_bracketing = depth == 0
correct_bracketing
bool
brackets = "()" depth = 0 for b in brackets: if b == "(": depth += 1 else: depth -= 1 if depth < 0: correct_bracketing = False correct_bracketing = depth == 0
depth
int
brackets = "()" depth = 0 for b in brackets: if b == "(": depth += 1
b
str
brackets = "()" depth = 0 for b in brackets: if b == "(": depth += 1
brackets
str
brackets = "()" depth = 0 for b in brackets: if b == "(": depth += 1
depth
int
brackets = "()" depth = 0
brackets
str
brackets = "()" depth = 0
depth
int
brackets = "()" depth = 0 for b in brackets: if b == "(": depth += 1 else:
b
str
brackets = "()" depth = 0 for b in brackets: if b == "(": depth += 1 else:
brackets
str
brackets = "()" depth = 0 for b in brackets: if b == "(": depth += 1 else:
depth
int
xs = [3, 2, 1, 0, 4] derivative = [(i * x) for i, x in enumerate(xs)][1:]
derivative
list
xs = [3, 2, 1, 0, 4] derivative = [(i * x) for i, x in enumerate(xs)][1:]
xs
list
n = 2 if n == 0: fibfib = 0 if n == 1: fibfib = 0 if n == 2: fibfib = 1
fibfib
int
n = 2 if n == 0: fibfib = 0 if n == 1: fibfib = 0 if n == 2: fibfib = 1
n
int
n = 2 if n == 0: fibfib = 0 if n == 1: fibfib = 0 if n == 2:
n
int
s = "keY" vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y':
n_vowels
int
s = "keY" vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y':
s
str
s = "keY" vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y':
vowels
str
s = "keY" vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s)
n_vowels
int
s = "keY" vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s)
s
str
s = "keY" vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s)
vowels
str
s = "keY" vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1
n_vowels
int
s = "keY" vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1
s
str
s = "keY" vowels = "aeiouAEIOU" n_vowels = sum(c in vowels for c in s) if s[-1] == 'y' or s[-1] == 'Y': n_vowels += 1
vowels
str
s = "keY" vowels = "aeiouAEIOU"
s
str
s = "keY" vowels = "aeiouAEIOU"
vowels
str
x, shift = 12, 2 s = str(x) if shift > len(s): circular_shift = s[::-1] else:
s
str
x, shift = 12, 2 s = str(x) if shift > len(s): circular_shift = s[::-1] else:
shift
int
x, shift = 12, 2 s = str(x) if shift > len(s): circular_shift = s[::-1] else:
x
int
x, shift = 12, 2 s = str(x) if shift > len(s): circular_shift = s[::-1] else: circular_shift = s[len(s) - shift:] + s[:len(s) - shift]
circular_shift
str
x, shift = 12, 2 s = str(x) if shift > len(s): circular_shift = s[::-1] else: circular_shift = s[len(s) - shift:] + s[:len(s) - shift]
s
str
x, shift = 12, 2 s = str(x) if shift > len(s): circular_shift = s[::-1] else: circular_shift = s[len(s) - shift:] + s[:len(s) - shift]
shift
int
x, shift = 12, 2 s = str(x) if shift > len(s): circular_shift = s[::-1] else: circular_shift = s[len(s) - shift:] + s[:len(s) - shift]
x
int
s = "You arE Very Smart" if s == "": digitSum = 0
s
str
s = "You arE Very Smart" if s == "": digitSum = 0 digitSum = sum(ord(char) if char.isupper() else 0 for char in s)
digitSum
int
s = "You arE Very Smart" if s == "": digitSum = 0 digitSum = sum(ord(char) if char.isupper() else 0 for char in s)
s
str
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '): if i.isdigit(): lis.append(int(i))
i
str
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '): if i.isdigit(): lis.append(int(i))
lis
list
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '): if i.isdigit(): lis.append(int(i))
n
int
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '): if i.isdigit(): lis.append(int(i))
s
str
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '):
i
str
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '):
lis
list
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '):
n
int
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '):
s
str
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '): if i.isdigit(): lis.append(int(i)) fruit_distribution = n - sum(lis)
fruit_distribution
int
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '): if i.isdigit(): lis.append(int(i)) fruit_distribution = n - sum(lis)
i
str
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '): if i.isdigit(): lis.append(int(i)) fruit_distribution = n - sum(lis)
lis
list
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '): if i.isdigit(): lis.append(int(i)) fruit_distribution = n - sum(lis)
n
int
s, n = "0 apples and 1 oranges",3 lis = list() for i in s.split(' '): if i.isdigit(): lis.append(int(i)) fruit_distribution = n - sum(lis)
s
str
s, n = "0 apples and 1 oranges",3 lis = list()
lis
list
s, n = "0 apples and 1 oranges",3 lis = list()
n
int
s, n = "0 apples and 1 oranges",3 lis = list()
s
str
arr = [] if(len(arr) == 0): pluck = [] evens = list(filter(lambda x: x%2 == 0, arr))
arr
list
arr = [] if(len(arr) == 0): pluck = [] evens = list(filter(lambda x: x%2 == 0, arr))
evens
list
arr = [] if(len(arr) == 0): pluck = [] evens = list(filter(lambda x: x%2 == 0, arr))
pluck
list
arr = [] if(len(arr) == 0): pluck = [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): pluck = []
arr
list
arr = [] if(len(arr) == 0): pluck = [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): pluck = []
evens
list
arr = [] if(len(arr) == 0): pluck = [] evens = list(filter(lambda x: x%2 == 0, arr)) if(evens == []): pluck = []
pluck
list
arr = [] if(len(arr) == 0): pluck = []
arr
list
arr = [] if(len(arr) == 0): pluck = []
pluck
list
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1) for i in lst:
frq
list
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1) for i in lst:
i
int
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1) for i in lst:
lst
list
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1) for i in lst: frq[i] += 1;
frq
list
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1) for i in lst: frq[i] += 1;
i
int
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1) for i in lst: frq[i] += 1;
lst
list
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1)
frq
list
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1)
lst
list
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1) for i in lst: frq[i] += 1;
frq
list
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1) for i in lst: frq[i] += 1;
i
int
lst = [8, 8, 3, 6, 5, 6, 4] frq = [0] * (max(lst) + 1) for i in lst: frq[i] += 1;
lst
list
lst = [111111] res, switch = [], True
lst
list
lst = [111111] res, switch = [], True
res
list
lst = [111111] res, switch = [], True
switch
bool
lst = [111111] res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1])
lst
list
lst = [111111] res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1])
res
list
lst = [111111] res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1])
switch
bool
lst = [111111] res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1]) switch = not switch
lst
list
lst = [111111] res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1]) switch = not switch
res
list
lst = [111111] res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1]) switch = not switch
switch
bool
lst = [111111] res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1]) switch = not switch strange_sort_list = res
lst
list
lst = [111111] res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1]) switch = not switch strange_sort_list = res
res
list
lst = [111111] res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1]) switch = not switch strange_sort_list = res
strange_sort_list
list
lst = [111111] res, switch = [], True while lst: res.append(min(lst) if switch else max(lst)) lst.remove(res[-1]) switch = not switch strange_sort_list = res
switch
bool
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a: triangle_area = -1 s = (a + b + c)/2
a
int
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a: triangle_area = -1 s = (a + b + c)/2
b
int
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a: triangle_area = -1 s = (a + b + c)/2
c
int
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a: triangle_area = -1 s = (a + b + c)/2
s
float
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a: triangle_area = -1 s = (a + b + c)/2
triangle_area
int
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a: triangle_area = -1
a
int
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a: triangle_area = -1
b
int
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a: triangle_area = -1
c
int
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a: triangle_area = -1
triangle_area
int
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a:
a
int
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a:
b
int
a, b, c = 2, 2, 10 if a + b <= c or a + c <= b or b + c <= a:
c
int
q, w = [3, 2, 3], 9 if sum(q) > w: will_it_fly = False
q
list