1. Squares of numbers from 1 to 10 as tuples
Sample Output
(1, 4, 9, 16, 25, 36, 49, 64, 81, 100)
2. Even numbers from 1 to 20 as tuples
Sample Output
(2, 4, 6, 8, 10, 12, 14, 16, 18, 20)
3. Tuple of characters in a string
Sample Output
hello
('h', 'e', 'l', 'l', 'o')
4. Length of words in a sentence as tuples
Sample Output
This is a sample sentence
(4, 2, 1, 6, 8)
5. Vowels in a sentence as tuples
Sample Output
Hello, how are you?
('e', 'o', 'o', 'a', 'e', 'o', 'u')
6. Tuple of distinct prime factors of numbers in a list
Sample Output
[10, 15, 20, 25]
(2, 5, 3, 5, 2, 5, 5)
7. Tuple of distinct characters in a list of strings
Sample Output
['apple', 'banana', 'cherry']
('a', 'p', 'p', 'l', 'e', 'b', 'a', 'n', 'a', 'n', 'a', 'c', 'h', 'e', 'r', 'r', 'y')
8. Tuple of ASCII values for characters in a string
Sample Output
hello
(104, 101, 108, 108, 111)
9. Tuple of common letters between two words
Sample Output
apple
banana
('a',)
10. Tuple of even squares up to 100
Sample Output
(0, 4, 16, 36, 64, 100)
11. Tuple of positive numbers from a list
Sample Output
[-5, 10, -15, 20, -25]
(10, 20)
12. Tuple of distinct consonants in a sentence
Sample Output
Hello, how are you?
('h', 'l', 'l', 'h', 'w', 'r', 'y')
13. Tuple of common elements between two lists
Sample Output
[1, 2, 3, 4, 5]
[4, 5, 6, 7, 8]
(4, 5)
14. Tuple of distinct vowels in a list of words
Sample Output
['apple', 'banana', 'cherry', 'date']
('a', 'e', 'a', 'a', 'a', 'e', 'a', 'e')
15. Tuple of distinct words starting with vowels in a sentence
Sample Output
Hello, how are you?
('are',)
16. Tuple of sums of digits in numbers
Sample Output
[123, 456, 789]
(6, 15, 24)
17. Tuple of words with length greater than 3 in a sentence
Sample Output
This is a sample sentence
('This', 'sample', 'sentence')
18. Tuple of pairs of elements and their squares
Sample Output
[1, 2, 3, 4, 5]
((1, 1), (2, 4), (3, 9), (4, 16), (5, 25))
19. Tuple of Negative numbers from a list
Sample Output
[-5, 10, -15, 20, -25]
(-5, -15, -25)
20. Tuple of positive and negative numbers from a list
Sample Output
[10, -5, 20, -15, 30]
(10, 20, 30)
(-5, -15)
21. Tuple of pairs of words and their lengths
Sample Output
['apple', 'banana', 'cherry', 'date']
(('apple', 5), ('banana', 6), ('cherry', 6), ('date', 4))
22. Tuple of characters and their corresponding ASCII values
Sample Output
['a', 'b', 'c', 'd', 'e']
(('a', 97), ('b', 98), ('c', 99), ('d', 100), ('e', 101))
23. Tuple of pairs of numbers and their sum from two lists
Sample Output
[1, 2, 3]
[4, 5, 6]
((1, 4, 5), (1, 5, 6), (1, 6, 7), (2, 4, 6), (2, 5, 7), (2, 6, 8), (3, 4, 7), (3, 5, 8), (3, 6, 9))
24. Tuple of odd numbers from 1 to 20
Sample Output
(1, 3, 5, 7, 9, 11, 13, 15, 17, 19)
25. Tuple of prime numbers up to 50
Sample Output
(2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47)
26. Tuple of factors of numbers in a list
Sample Output
[10, 15, 20, 25]
((10, [1, 2, 5, 10]), (15, [1, 3, 5, 15]), (20, [1, 2, 4, 5, 10, 20]), (25, [1, 5, 25]))
27. Tuple of distinct vowels and consonants from a list of words
Sample Output
['apple', 'banana', 'cherry', 'date']
('a', 'e', 'a', 'a', 'a', 'e', 'a', 'e')
('p', 'p', 'l', 'b', 'n', 'n', 'c', 'h', 'r', 'r', 'y', 'd', 't')
28. Tuple of tuples with word and its vowel count in a sentence
Sample Output
Hello, how are you?
(('Hello,', 2), ('how', 1), ('are', 2), ('you?', 2))
29. Tuple of distinct divisors of numbers in a list
Sample Output
[10, 15, 20, 25]
({1, 2, 10, 5}, {1, 3, 5, 15}, {1, 2, 4, 5, 10, 20}, {1, 5, 25})
30. Tuple of words with at least one vowel in a sentence
Sample Output
Hello, how are you?
('Hello,', 'how', 'are', 'you?')
31. Tuple of common letters between words of different lengths
Sample Output
apple
cherry
('e',)
32. Tuple of tuples with word and its reversed form
Sample Output
['apple', 'banana', 'cherry', 'date']
(('apple', 'elppa'), ('banana', 'ananab'), ('cherry', 'yrrehc'), ('date', 'etad')))
33. Tuple of distinct substrings from a word
Sample Output
hello
('h', 'he', 'hel', 'hell', 'hello', 'e', 'el', 'ell', 'ello', 'l', 'll', 'llo', 'l', 'lo', 'o')
34. Tuple of tuples with element and its factorial
Sample Output
[1, 2, 3, 4, 5]
((1, 1), (2, 2), (3, 6), (4, 24), (5, 120))
35. Tuple of pairs of words and their common letters
Sample Output
apple
cherry
(('e', 'e'),)
36. Tuple of words containing 'a' or 'e' in a sentence
Sample Output
This is a sample sentence with various words.
('a', 'sample', 'sentence', 'various')
37. Tuple of pairs of numbers and their product from two lists
Sample Output
[1, 2, 3]
[4, 5, 6]
((1, 4, 4), (1, 5, 5), (1, 6, 6), (2, 4, 8), (2, 5, 10), (2, 6, 12), (3, 4, 12), (3, 5, 15), (3, 6, 18))
38. Tuple of distinct words with length greater than 4 in a sentence
Sample Output
This is a sample sentence with words of various lengths.
('sample', 'sentence', 'words', 'various', 'lengths.')
39. Unique elements from a list as a tuple
Sample Output
[1, 2, 2, 3, 4, 4, 5, 5]
(1, 2, 3, 4, 5)
40. Unique characters in a string as a tuple
Sample Output
hello
('o', 'e', 'l', 'h')
41. Unique words in a sentence as a tuple
Sample Output
This is a sample sentence with repeated words is
('This', 'words', 'sample', 'with', 'a', 'repeated', 'sentence', 'is')
42. Distinct elements from multiple lists while preserving order as a tuple
Sample Output
[1, 2, 3, 4, 5]
[4, 5, 6, 7, 8]
(1, 2, 3, 4, 5, 6, 7, 8)
43. Pairs of distinct words and their reversed forms in a sentence as a tuple
Sample Output
Hello, how are you?
(('are', 'era'), ('you?', '?uoy'), ('Hello,', ',olleH'), ('how', 'woh'))
44. Distinct elements from a list of mixed data types as a tuple
Sample Output
[1, 'apple', 2.5, 'banana', 3, 'cherry']
(1, 2.5, 3, 'cherry', 'apple', 'banana')
45. Pairs of distinct elements and their sum of digits, using divmod(), from two lists as a tuple
Sample Output
[123, 456, 789]
[234, 567, 890]
((123, 234, 42), (456, 890, 140), (789, 890, 176), (456, 567, 114), (456, 234, 78), (123, 890, 104), (123, 567, 78), (789, 234, 114), (789, 567, 150))
46. Distinct elements from multiple lists using set symmetric difference, as a tuple
Sample Output
[1, 2, 3, 4]
[3, 4, 5, 6]
[5, 6, 7, 8]
(1, 2, 7, 8)
47. Pairs of numbers and their sum, with even and odd pairs separated, from two lists as a tuple
Sample Output
[1, 2, 3]
[4, 5, 6]
(((1, 5, 6), (2, 4, 6), (2, 6, 8), (3, 5, 8)), ((1, 4, 5), (1, 6, 7), (2, 5, 7), (3, 4, 7), (3, 6, 9)))
48. Pairs of distinct elements and their sum of digits from two lists as a tuple
Sample Output
[123, 456, 789]
[234, 567, 890]
((123, 234, 15), (123, 567, 24), (123, 890, 23), (456, 234, 24), (456, 567, 33), (456, 890, 32), (789, 234, 33), (789, 567, 42), (789, 890, 41))
49. Distinct characters from multiple strings with case-insensitivity as a tuple
Sample Output
['apple', 'Banana', 'Cherry']
('e', 'h', 'b', 'n', 'c', 'r', 'p', 'y', 'a', 'l')
50. Pairs of distinct words and their lengths, excluding words with lengths not divisible by 3, in a sentence as a tuple
Sample Output
Hello, how are you?
(('how', 3), ('Hello,', 6), ('are', 3))
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions