Py_ass_4
Py_ass_4
2. Given the tuple 'numbers = (1, 2, 3, 4, 5)', use slicing to print the
subtuple '(2, 3, 4)’.
9. Create a tuple 'letters' with the elements '('a', 'b', 'c', 'd')'. Convert
the tuple to a string by joining the elements with a comma separator
and print the resulting string.
10. Given the tuple 'records = ((1, "Alice"), (2, "Bob"), (3, "Charlie"))',
iterate over the tuple and print each ID and name on a new line.