prompt stringlengths 14 2.1k | completion stringlengths 0 10.3k | concept stringclasses 200
values |
|---|---|---|
<?code colors = ["red", "green", "blue"]?> | <?for (i, color) in enumerate(colors)?><?print i?>: <?print color?>, <?end for?> | enumerate |
<?code weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]?> | <?for (i, day) in enumerate(weekdays, 1)?><?print i?>. <?print day?>
<?end for?> | enumerate |
<?code my_list = ["apple", "banana", "cherry"]?> | <?for (i, item) in enumerate(my_list)?>Item at index <?print i?> is <?print item?>.
<?end for?> | enumerate |
<?code my_string = "UL4"?> | <?for (i, char) in enumerate(my_string)?>Character at <?print i?> is <?print char?>.
<?end for?> | enumerate |
<?code list1 = [False, False, False]?><?code list2 = [False, True, False]?><?code list3 = [True, True, True]?> | <?print any(list1)?><?print any(list2)?><?print any(list3)?> | any |
<?code list1 = [False, False, False]?><?code list2 = [False, True, False]?><?code list3 = [True, False, True]?> | <?print any(list1)?><?print any(list2)?><?print any(list3)?> | any |
<?code list1 = [False, False, False]?><?code list2 = [False, True, False]?><?code list3 = [True, True, True]?><?code list4 = []?> | <?print any(list1)?><?print any(list2)?><?print any(list3)?><?print any(list4)?> | any |
<?code list1 = [1, 0, 0]?><?code list2 = [0, 1, 0]?><?code list3 = [1, 1, 1]?><?code list4 = [0, 0, 0]?> | <?print any(list1)?><?print any(list2)?><?print any(list3)?><?print any(list4)?> | any |
<?code list1 = [False, None, 0]?><?code list2 = [False, True, 0]?><?code list3 = [1, "", True]?><?code list4 = [None, 0, False]?> | <?print any(list1)?><?print any(list2)?><?print any(list3)?><?print any(list4)?> | any |
<?code list1 = [False, False, False, False]?><?code list2 = [False, False, True, False]?><?code list3 = []?> | <?print any(list1)?><?print any(list2)?><?print any(list3)?> | any |
<?code a = [False, True, False]?><?code b = [1, 0, 1]?><?code c = [False, 0, None]?><?code d = []?><?code e = ['hello', '', 'world'] ?> | <?print any(a)?><?print any(b)?><?print any(c)?><?print any(d)?><?print any(e)?> | any |
<?code a = [False, 0, '', None]?><?code b = [False, 0, 'hi', None]?><?code c = [False, 0, '', {}]?><?code d = [False, 0, '', []]?><?code e = [False, 0, '', 0.0]?> | <?print any(a)?><?print any(b)?><?print any(c)?><?print any(d)?><?print any(e)?> | any |
<?code a = {'a': False, 'b': 0, 'c': ''}?><?code b = {'a': False, 'b': 0, 'c': 'hi'}?><?code c = {'a': False, 'b': True, 'c': ''}?> | <?print any(a.values())?><?print any(b.values())?><?print any(c.values())?> | any |
<?code a = [False, False, False]?><?code b = [0, 0.0, 0]?><?code c = ['', '', ''] ?><?code d = [None, None, None]?> | <?print any(a)?><?print any(b)?><?print any(c)?><?print any(d)?> | any |
<?code a = [True, True, True]?><?code b = [True, False, True]?><?code c = [1, 1, 1]?><?code d = [1, 0, 1]?><?code e = ['hi', 'hello', 'hey'] ?><?code f = ['hi', '', 'hey'] ?> | <?print all(a)?><?print all(b)?><?print all(c)?><?print all(d)?><?print all(e)?><?print all(f)?> | all |
<?code list1 = [True, True, True]?><?code list2 = [True, False, True]?><?code list3 = [False, False, False]?> | <?print all(list1)?><?print all(list2)?><?print all(list3)?> | all |
<?code a = [1, 2, 3]?><?code b = [0, 2, 3]?><?code c = []?> | <?print all(x > 0 for x in a)?><?print all(x > 0 for x in b)?><?print all(x > 0 for x in c)?> | all |
<?code a = {1: True, 2: True}?><?code b = {1: True, 2: False}?><?code c = {}?> | <?print all(a.values())?><?print all(b.values())?><?print all(c.values())?> | all |
<?code a = [False, None, 0]?><?code b = [True, 1, 'a'] ?><?code c = [True, True]?><?code d = []?> | <?print all(a)?><?print all(b)?><?print all(c)?><?print all(d)?> | all |
<?code list1 = [True, True, True]?><?code list2 = [True, False, True]?><?code list3 = []?> | <?print all(list1)?><?print all(list2)?><?print all(list3)?> | all |
<?code a = [1, 2, 3]?><?code b = [0, 1, 2]?><?code c = [True, False]?><?code d = [True, True]?> | <?print all(x > 0 for x in a)?><?print all(x > 0 for x in b)?><?print all(c)?><?print all(d)?> | all |
<?code a = {'x': True, 'y': True}?><?code b = {'x': False, 'y': True}?><?code c = {}?> | <?print all(a.values())?><?print all(b.values())?><?print all(c.values())?> | all |
<?code a = [True]?><?code b = [False]?><?code c = [True, True, False]?><?code d = [True, True]?> | <?print all(a)?><?print all(b)?><?print all(c)?><?print all(d)?> | all |
<?code a = [1, 2, 0]?><?code b = [False, True, 1]?><?code c = ["a", "b", ""]?><?code d = []?> | <?print all(a)?><?print all(b)?><?print all(c)?><?print all(d)?> | all |
<?code data = {'name': 'John Doe', 'age': 30, 'city': 'New York'}?> | <?print asjson(data)?> | asjson |
<?code data = {'nested': {'a': 1, 'b': 'two', 'c': True}, 'd': [4, 5, 6]}?> | <?print asjson(data)?> | asjson |
<?code a = {'one': 1, 'two': '2', 'three': [3], 'four': {'a': 'A', 'b': 'B'}}?> | <?print asjson(a)?> | asjson |
<?code data = [1, 2, 3, "four", True, None]?> | <?print asjson(data)?> | asjson |
<?code my_set = {1, 2, "three", True}?> | <?print asjson(my_set)?> | asjson |
<?code complex_dict = {'a': 1, 'b': {'c': 'two', 'd': [3, 4]}, 'e': True, 'f': None}?> | <?print asjson(complex_dict)?> | asjson |
<?code data = {'name': 'John Doe', 'age': 30, 'city': 'New York'}?> | <?print asjson(data)?> | asjson |
<?code a = {'nested': {'list': [1, 2, 3], 'bool': True}, 'string': 'hello'}?> | <?print asjson(a)?> | asjson |
<?code data = [1, "two", True, None]?> | <?print asjson(data)?> | asjson |
<?code json_string = '"Hello, world!"'?> | <?print fromjson(json_string)?> | fromjson |
<?code json_string = '{\"name\": \"John Doe\", \"age\": 30, \"city\": \"New York\", \"occupation\": null}'?> | <?code person = fromjson(json_string)?><?print person.name?> is <?print person.age?> years old and lives in <?print person.city?>. | fromjson |
<?code json_string = '[\"apple\", \"banana\", \"cherry\"]'?> | <?code fruits = fromjson(json_string)?><?print fruits[0]?>, <?print fruits[1]?>, and <?print fruits[2]?> are fruits. | fromjson |
<?code json_string = '{\"nested\": {\"key\": \"value\"}}'?> | <?code data = fromjson(json_string)?><?print data.nested.key?> | fromjson |
<?code json_string = '{\"numbers\": [1, 2, 3.14, -5, 0]}'?> | <?code data = fromjson(json_string)?><?print len(data.numbers)?> <?for n in data.numbers?><?print n?><?end for?> | fromjson |
<?code json_string = '{\"name\": \"Alice\", \"age\": 30}'?> | <?code person = fromjson(json_string)?><?print person.name?> is <?print person.age?> years old. | fromjson |
<?code json_string = '{\"boolean_values\": [true, false, true]}'?> | <?code data = fromjson(json_string)?><?for value in data.boolean_values?><?if value?>True<?else?>False<?end if?> <?end for?> | fromjson |
<?code json_string = '{\"nested\": {\"list\": [1, 2, 3], \"string\": \"hello\"}}'?> | <?code data = fromjson(json_string)?><?print data.nested.string?>: <?for x in data.nested.list?><?print x?>, <?end for?> | fromjson |
<?code json_string = '{\"city\": \"New York\", \"country\": \"USA\"}'?> | <?code location = fromjson(json_string)?><?print location.city?>, <?print location.country?> | fromjson |
<?code json_string = '{\"numbers\": [1, 2.5, -3, 4.0]}'?> | <?code data = fromjson(json_string)?><?for number in data.numbers?><?print number?>, <?end for?> | fromjson |
<?code data = {'a': 1, 'b': 'two', 'c': [3, 3.14]}?> | <?code ul4on_string = asul4on(data)?><?print ul4on_string?> | asul4on |
<?code data = {'name': 'Alice', 'age': 30}?> | <?code ul4on_data = asul4on(data)?><?print ul4on_data?> | asul4on |
<?code my_set = {1, 2, 3}?> | <?code ul4on_string = asul4on(my_set)?><?print ul4on_string?> | asul4on |
<?code a_string = "hello"?> | <?print asul4on(a_string)?> | asul4on |
<?code an_int = 42?> | <?print asul4on(an_int)?> | asul4on |
<?code a_float = 3.14159?> | <?print asul4on(a_float)?> | asul4on |
<?code a_list = [1, "two", 3.0, True]?> | <?print asul4on(a_list)?> | asul4on |
<?code a_dict = {'name': 'John Doe', 'age': 30, 'city': 'New York'}?> | <?print asul4on(a_dict)?> | asul4on |
<?code a_set = {1, 2, 3}?> | <?print asul4on(a_set)?> | asul4on |
<?code a = 1?><?code b = 'hello'?><?code c = True?> | <?print repr(a)?> <?print repr(b)?> <?print repr(c)?> | repr |
<?code a = 'hello'?><?code b = 42?><?code c = @(2024-03-15)?> | <?print repr(a + repr(b) + repr(c))?> | repr |
<?code a = {'x': 1, 'y': 'hello'}?><?code b = [1, 2, 3]?><?code c = 'foo'?> | <?print repr(a) + repr(b) + repr(c)?> | repr |
<?code a = {'name': 'John Doe', 'age': 30}?> | <?print repr(a.age)?> | repr |
<?code a = 'hello'?><?code b = 42?><?code c = True?><?code d = @(2024-03-15)?><?code e = #f00?><?code f = [1, 2, 3]?><?code g = {'x': 1, 'y': 2}?><?code h = {1, 2, 3}?> | <?print repr(a) + ' ' + repr(b) + ' ' + repr(c) + ' ' + repr(d) + ' ' + repr(e) + ' ' + repr(f) + ' ' + repr(g) + ' ' + repr(h)?> | repr |
<?code a = {'foo': 'bar', 'baz': 42}?> | <?print repr(a)?> | repr |
<?code a = {'foo': 'bar', 'baz': {1, 2, 3}}?> | <?print repr(a['baz'])?> | repr |
<?code a = 'hello'?><?code b = 'world'?> | <?print repr(a) + ' ' + repr(b)?> | repr |
<?code a = [1, 2, 3]?><?code b = {'foo': 'bar'}?> | <?print repr(a + [b])?> | repr |
<?code name = 'José'?> | <?print ascii(name)?> | ascii |
<?code a = 'hello'?><?code b = 'world'?> | <?print ascii(a + ' ' + b)?> | ascii |
<?code a = '\n'?> | <?print ascii(a)?> | ascii |
<?code data = {'name': 'Jösé', 'age': 42}?> | <?print ascii(data)?> | ascii |
<?code a = 'föö'?> | <?print ascii(a)?> | ascii |
<?code a = 'foo'?><?code b = 'bar'?> | <?print ascii(a + b)?> | ascii |
<?code s = '\u00fc'?> | <?print ascii(s)?> | ascii |
<?code a = {'b': 'föö'}?> | <?print ascii(a)?> | ascii |
<?code a = [1, 'föö', True]?> | <?print ascii(a)?> | ascii |
<?code text = 'This is a test with some non-ASCII chars: äöüß'?> | <?print ascii(text)?> | ascii |
<?code codepoint = 97?> | <?print chr(codepoint)?> | chr |
<?code codepoint = 0x41?> | <?print chr(codepoint)?> | chr |
<?code codepoint = 100?> | <?print chr(codepoint)?> | chr |
<?code codepoints = [72, 101, 108, 108, 111]?> | <?print ''.join(chr(c) for c in codepoints)?> | chr |
<?code char_code = 97?> | <?print chr(char_code)?> | chr |
<?code char_code1 = 65?><?code char_code2 = 66?><?code char_code3 = 67?> | <?print chr(char_code1) + chr(char_code2) + chr(char_code3)?> | chr |
<?code char_codes = [0x48, 0x65, 0x6c, 0x6c, 0x6f]?> | <?print ''.join(chr(c) for c in char_codes)?> | chr |
<?code char_code = 0x30?> | <?print chr(char_code)?> | chr |
<?code char_code = 97?> | <?print chr(char_code)?> | chr |
<?code code_points = [72, 101, 108, 108, 111, 33]?> | <?print ''.join(chr(cp) for cp in code_points)?> | chr |
<?code char = 'A'?> | <?print ord(char)?> | ord |
<?code char_list = ['a', 'b', 'c'] ?> | <?print [ord(c) for c in char_list]?> | ord |
<?code char = '€'?> | <?print ord(char)?> | ord |
<?code s = '\u2603'?> | <?print ord(s)?> | ord |
<?code char_code = 97 ?> | <?print ord(chr(char_code))?> | ord |
<?code char_list = ['a', 'b', 'c'] ?> | <?print ', '.join(str(ord(c)) for c in char_list)?> | ord |
<?code char_codes = {97: 'a', 98: 'b', 99: 'c'} ?> | <?print ', '.join(str(ord(v)) for v in char_codes.values())?> | ord |
<?code char = '€' ?> | <?print ord(char)?> | ord |
<?code number = 255 ?> | <?print hex(number)?> | hex |
<?code number = 12345 ?> | <?print hex(number)?> | hex |
<?code number = 10?> | <?print hex(number)?> | hex |
<?code number = -1?> | <?print hex(number)?> | hex |
<?code number = 0?> | <?print hex(number)?> | hex |
<?code numbers = [10, 20, 30, 40, 50]?> | <?for number in numbers?><?print hex(number)?>
<?end for?> | hex |
<?code number = 1234567890?> | <?print hex(number)?> | hex |
<?code number = -1?> | <?print hex(number)?> | hex |
<?code numbers = [1, 2, 3, 4, 5]?> | <?code hex_numbers = [hex(n) for n in numbers]?><?print hex_numbers?> | hex |
<?code number = 0?> | <?print hex(number)?> | hex |
<?code number = 12345?> | <?print oct(number)?> | oct |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.