163k views
0 votes
Initialize the tuple team_names with the strings 'Rockets', 'Raptors', 'Warriors', and 'Celtics' (The top-4 2018 NBA teams at the end of the regular season in order). Sample output for the given program: Rockets Raptors Warriors Celtics

1 Answer

4 votes

Answer:

Following is the code in python language

team_names = ('Rockets','Raptors','Warriors','Celtics')#holding the string value

print(team_names[0],team_names[1],team_names[2],team_names[3])#display

Output:

Rockets Raptors Warriors Celtics

Step-by-step explanation:

Following is the description of above statement .

  • Create a dictionary "team_names" that is holding the string value Rockets Raptors Warriors and Celtics.
  • Finally we used the print function in that function we pass the index of corresponding dictionary i.e team_names[0] . it will display the first index value similarly we pass team_names[1], team_names[2] team_names[3].
User Joshua Zastrow
by
4.3k points