1. Generate a set of squares of numbers from 1 to 10
Sample Output
{64, 1, 4, 36, 100, 9, 16, 49, 81, 25}
2. Create a set of even numbers from 1 to 20
Sample Output
{2, 4, 6, 8, 10, 12, 14, 16, 18, 20}
3. Generate a set of characters from a string
Sample Output
Hello, world!
{'e', 'r', 'o', 'H', 'w', 'l', 'd'}
4. Create a set of lengths of words in a sentence
Sample Output
This is a sample sentence.
{1, 2, 4, 6, 9}
5. Generate a set of prime numbers from 1 to 50
Sample Output
{2, 3, 5, 37, 7, 41, 11, 43, 13, 47, 17, 19, 23, 29, 31}
6. Create a set of lowercase letters
Sample Output
{'a', 'e', 'u', 'z', 'y', 'j', 'k', 't', 'x', 'd', 'r', 'v', 'o', 'h', 'f', 'i', 'c', 'g', 'l', 'p', 'b', 'n', 'm', 'q', 's', 'w'}
7. Generate a set of uppercase letters
Sample Output
{'U', 'M', 'F', 'D', 'A', 'I', 'R', 'Y', 'V', 'N', 'T', 'P', 'X', 'O', 'C', 'L', 'W', 'Q', 'K', 'J', 'H', 'Z', 'E', 'G', 'S', 'B'}
8. Create a set of even numbers squared and odd numbers cubed from 1 to 10
Sample Output
{64, 1, 4, 36, 100, 16, 343, 729, 27, 125}
9. Generate a set of common multiples of 3 and 5 up to 100
Sample Output
{75, 45, 15, 90, 60, 30}
10. Create a set of reversed strings from another set
Sample Output
{'cherry', 'apple', 'banana'}
{'ananab', 'elppa', 'yrrehc'}
11. Generate a set of positive square roots from a set of positive numbers
Sample Output
{16, 1, 4, 9, 25}
{1.0, 2.0, 3.0, 4.0, 5.0}
12. Create a set of uppercase words from a sentence
Sample Output
This is a sample sentence.
{'SAMPLE', 'THIS', 'SENTENCE.', 'A', 'IS'}
13. Generate a set of non-vowel characters from a string
Sample Output
Hello, world!
{' ', '!', 'w', ',', 'r', 'H', 'l', 'd'}
14. Create a set of unique numbers from a list
Sample Output
[1, 2, 3, 2, 4, 5, 1]
{1, 2, 3, 4, 5}
15. Generate a set of ASCII values of characters from a string
Sample Output
Hello, world!
{32, 33, 100, 101, 72, 108, 44, 111, 114, 119}
16. Generate a set of tuples containing numbers and their squares
Sample Output
{(2, 4), (4, 16), (1, 1), (3, 9), (5, 25)}
17. Create a set of vowels from a string
Sample Output
Hello, world!
{'e', 'o'}
18. Generate a set of numbers that are perfect squares from 1 to 100
Sample Output
{64, 1, 4, 36, 100, 9, 16, 49, 81, 25}
19. Generate a set of characters that are digits from a string
Sample Output
12345Hello67890
{'2', '8', '7', '3', '9', '0', '1', '5', '4', '6'}
20. Create a set of numbers that are powers of 2 from 1 to 10
Sample Output
{32, 64, 2, 128, 4, 256, 512, 1024, 8, 16}
21. Generate a set of common elements from two lists
Sample Output
[1, 2, 3, 4, 5]
[3, 4, 5, 6, 7]
{3, 4, 5}
22. Generate a set of characters that are not alphanumeric from a string
Sample Output
Hello, world!
{'!', ' ', ','}
23. Create a set of characters that are consonants from a string
Sample Output
Hello, world!
{'H', 'r', 'w', 'd', 'l'}
24. Create a set of strings with characters in uppercase
Sample Output
{'banana', 'apple', 'cherry'}
{'APPLE', 'BANANA', 'CHERRY'}
25. Create a set of words with their characters sorted
Sample Output
{'banana', 'apple', 'cherry'}
{'aaabnn', 'aelpp', 'cehrry'}
26. Generate a set of tuples containing even and odd numbers from 1 to 10
Sample Output
{(3, 4), (5, 4), (3, 10), (9, 2), (5, 10), (9, 8), (1, 6), (7, 4), (7, 10), (5, 6), (3, 6), (9, 4), (9, 10), (1, 2), (1, 8), (7, 6), (3, 2), (5, 2), (3, 8), (5, 8), (9, 6), (1, 4), (1, 10), (7, 2), (7, 8)}
27. Create a set of words with their vowels replaced by underscores
Sample Output
{'banana', 'cherry', 'apple'}
{'_ppl_', 'ch_rry', 'b_n_n_'}
28. Generate a set of tuples containing numbers and their cubes
Sample Output
{(3, 27), (4, 64), (1, 1), (5, 125), (2, 8)}
29. Create a set of unique characters from a list of words
Sample Output
['apple', 'banana', 'cherry']
{'y', 'a', 'e', 'c', 'b', 'p', 'l', 'n', 'h', 'r'}
30. Generate a set of tuples containing numbers and their absolute values
Sample Output
[-2, 3, -5, 7, -11]
{(7, 7), (-11, 11), (3, 3), (-5, 5), (-2, 2)}
31. Create a set of words with their characters repeated twice
Sample Output
['apple', 'banana', 'cherry']
{'aappppllee', 'bbaannaannaa', 'cchheerrrryy'}
32. Generate a set of tuples containing numbers and their squares, but only for even numbers
Sample Output
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
{(2, 4), (4, 16), (8, 64), (10, 100), (6, 36)}
33. Create a set of numbers that are perfect cubes from 1 to 100
Sample Output
{8, 1, 27}
34. Create a set of non-whitespace characters from a string
Sample Output
Hello, world!
{'e', 'r', 'H', 'd', 'w', ',', 'l', '!', 'o'}
35. Create a set of even numbers from 1 to 50 that are not divisible by 4
Sample Output
{2, 34, 6, 38, 10, 42, 14, 46, 18, 50, 22, 26, 30}
36. Generate a set of common elements from multiple sets
Sample Output
{1, 2, 3, 4, 5}
{3, 4, 5, 6, 7}
{5, 6, 7, 8, 9}
{5}
37. Create a set of strings with their vowels removed
Sample Output
{'banana', 'cherry', 'apple'}
{'chrry', 'ppl', 'bnn'}
38. Generate a set of words that start with a vowel from a sentence
Sample Output
This is a sample sentence with words starting with vowels.
{'a', 'is'}
39. Create a set of unique vowels from a list of words
Sample Output
['apple', 'banana', 'cherry']
{'a', 'e'}
40. Create a set of numbers that are palindromes from 1 to 100
Sample Output
{1, 2, 3, 4, 5, 6, 7, 8, 9, 33, 11, 44, 66, 77, 99, 22, 55, 88}
41. Generate a set of words that are anagrams from a list of words
Sample Output
['apple', 'banana', 'elppa', 'race', 'care', 'cherry']
{'aaabnn', 'cehrry', 'aelpp', 'acer'}
42. Create a set of words with their characters sorted in descending order
Sample Output
['apple', 'banana', 'cherry']
{'pplea', 'yrrhec', 'nnbaaa'}
43. Generate a set of characters that appear exactly twice in a string
Sample Output
Hello, world!
{'o'}
44. Create a set of strings with all characters capitalized from a list of strings
Sample Output
['apple', 'banana', 'cherry']
{'Banana', 'Apple', 'Cherry'}
45. Generate a set of words with at least one vowel from a list of words
Sample Output
['apple', 'banana', 'cherry']
{'banana', 'apple', 'cherry'}
46. Create a set of words with their characters repeated three times from a list of words
Sample Output
['apple', 'banana', 'cherry']
{'bbbaaannnaaannnaaa', 'aaappppppllleee', 'ccchhheeerrrrrryyy'}
47. Create a set of words with their characters sorted and concatenated
Sample Output
['apple', 'banana', 'cherry']
{'aelpp', 'cehrry', 'aaabnn'}
48. Create a set of words with their characters shuffled from a list of words
Sample Output
['apple', 'banana', 'cherry']
{'hreyrc', 'nbaana', 'lepap'}
49. Filtering out negative numbers from a set
Sample Output
{1, 3, 5, -4, -2}
{1, 3, 5}50. Generating pairs of elements from two sets
Sample Output
{1, 2, 3}
{'b', 'c', 'a'}
{(2, 'b'), (3, 'a'), (3, 'b'), (1, 'b'), (1, 'a'), (2, 'c'), (3, 'c'), (1, 'c'), (2, 'a')}
51. Checking for palindrome words
Sample Output
['radar', 'hello', 'level', 'world']
{'radar', 'level'}
52. Converting list of dictionaries to a set
Sample Output
[{'a': 1, 'b': 2}, {'b': 2, 'c': 3}, {'c': 3, 'd': 4}]
{frozenset({('a', 1), ('b', 2)}), frozenset({('d', 4), ('c', 3)}), frozenset({('b', 2), ('c', 3)})}
53. Removing punctuation from a string
Sample Output
Hello, world! How's everything?
{'e', ' ', 'g', 'o', 'h', 'd', 'l', 's', 'r', 'y', 'w', 't', 'H', 'n', 'v', 'i'}
54. Set of words with a given prefix
Sample Output
['apple', 'banana', 'cherry', 'date']
ba
{'banana'}
55. Merging characters from a list of strings
Sample Output
['apple', 'banana', 'cherry']
{'r', 'b', 'p', 'n', 'a', 'e', 'c', 'h', 'y', 'l'}
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions