Tag: Tuples

September 3, 2023

Python Tuples Exercises

What is the output of this program? students = ([“John”, “Doe”], [“Jane”, “Smith”], [“Mike”, “Johnson”]) def print_student_info(students, student_index): print(‘Student name:’, students[student_index][0]) print(‘Student lastname:’, students[student_index][1]) print_student_info(students, 2) Student name: MikeStudent lastname: Johnson Student name: JaneStudent lastname: Smith Submit What is the output of this program? students = ([“John”, “Doe”], [“Jane”, “Smith”], [“Mike”, “Johnson”]) def print_student_info(students, student_index): […]

September 3, 2023

Python Tuples Exercises

How do you describe the contents of the students? students = [ (“John”, 20, “Computer Science”), (“Emily”, 22, “Mathematics”), (“Michael”, 21, “Physics”), (“Sarah”, 19, “Biology”) ] A list of tuples A tuple of lists Submit What is the output of this program? students = [ (“John”, 20, “Computer Science”), (“Emily”, 22, “Mathematics”), (“Michael”, 21, “Physics”), […]