Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python-------------- Lists [] Create an empty list and print the list Create a singleton list and print the list Create a list of 5 items

Python--------------

image text in transcribed

image text in transcribed

image text in transcribed

Lists [] Create an empty list and print the list Create a singleton list and print the list Create a list of 5 items of mixed types and print the list Print the 3rd item in the list Print the item at index -3 Change the 3rd item in the list to "bye" and print the whole list Change the -4th item in the list to 'hello' and print the whole list Print the length of the list Find the min and max of the list Delete the -5th item in the list Add list ['heaven', -986] to the beginning of your list Append list ['abc',1,"ABC" ] to the end of your list Add 'hello' to the end of your list. What happened? Append "world" to the end of your list. What happened? Print your list, perform pop() on your list, and print the list again Perform pop(4) on your list and print the list Perform pop(-2) on your list and print the list Print the length of your list as a float Print the type and ord of your list Tuples () Create an empty tuple and print the tuple Create a singleton tuple and print the tuple Create a tuple of 5 items of mixed types and print the tuple Print the 3rd item in the tuple Print the item at index -3 Change the 3rd item in the tuple to "bye" and print the whole tuple Change the -4th item in the tuple to 'hello' and print the whole tuple Print the length of the tuple Find the min and max of the tuple Delete the -5th item in the tuple Add tuple ['heaven', -986] to the beginning of your tuple Append tuple ['abc',1,"ABC" ] to the end of your tuple Add 'hello' to the end of your tuple. What happened? Append "world" to the end of your tuple. What happened? Print your tuple, perform pop() on your tuple, and print the tuple again Perform pop(4) on your tuple and print the tuple Perform pop(-2) on your tuple and print the tuple Print the length of your tuple as a float Print the type and ord of your tuple Dict { } Build a dictionary with 6 college & mascot associations, using all three methods A = { key : value, key : value } A = dict( [(key, value), (key,value)] ) A=dict( key=value, key=value ) Access the dictionary using a key that doesn't exist Add a new value to the dictionary and print the dictionary Change the value of an existing entry and print the dictionary Del an entry from the dictionary Check to see if a value is 'in' the dictionary and also 'not in' the dictionary Get the length of the dictionary Print a list of sorted keys to the dictionary

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions