Question: Using Python, help me with this. Thank you so much! Here, sorry about that. Using Python Tuples 1 Create a variable named tuplelist and assign
![assign the value of (1,2,3,4,5) 2 Print the following values: a numberlist[0]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/6703ff6dccd76_2456703ff6d6e200.jpg)
Using Python Tuples 1 Create a variable named tuplelist and assign the value of (1,2,3,4,5) 2 Print the following values: a numberlist[0] b. numberlist[1] C numberlist[2] d numberlist[3] e numberlist[41 f numberlist[5] 3 Print the output of tuplelist + (1,2,3) 4 Assign tuplelist[0] - 15 5 Observe the output. 6 Try string slicing through the elements of tuplelist as in numberlist and message. 7. Create a for loop that would print the numbers inside the tuple. Dictionaries 1 Create a dictionary named contactinfo = {"id":1, "first_name":"John", "last_name*: 'Doe', 'contact_number":"09060611233"} 2 Print the following values: a contactinfo["id"] b. contactinfo["first_name'] C contactinfo["last_name") d contactinfo contact number'] e contactinfo[age") 3 Type the code: for k, v in contactinfo: print(k) 4 Type the code: for kv in contactinfo.items(): print(k,v) 5 Assign the values: a contactinfo["id"] = 2 b. contactinfo["first_name'] = "Max* 6 Print contactinfo Using Python 1 Create a variable numberlist and assign it the value of [5.4.2.1.3). 2 Print the following values below: a len(numberlist) numberlist[01 Cnumberlist[1] d numberlist/21 e numberlist[31 f numberlist[41 9 numberlist[31 h numberlist[-11 i numberlist-21 numberlist[-31 k numberlist[-41 numberlist - 5 m numberlist[-61 Reminder: Use the print() command. The values numberlist[5] and numberlist(-6) should return an error, 3 Write your observation after printing all the values. 4 Create a variable named itemlist and assign it the value of [1.-2.0,1,2,3), "Word"] 5 Print the following values below: a len(itemlist) bitemlist (O7 citemlist 111 ditemlist [2] e itemlist (31 len(itemlist/21) g itemlist (2110 n itemlist (20111 i itemlist (2012) i itemlist [-11 K itemlist 1-21 1 itemlist |-31 mitemlist 1-41 n len(itemlist[-2D) o itemlist[-2001 pitemlisi-2011 9 itemlist[-2][21 itemlist[-2]1-31 Sitemlist[-2]|-21 itemlist-21-11 6 Write your observation after printing all the values. What does len() do? Using Python Index Slicing 1 Create a new variable longlist and assign it the value of numberlist + itemlist. 2 Print the following values below and write your observation for each of the following sub-groups (sub- headings) a len(longlist) blonglist a longlist[:91 d longlist[:] e longlist[1:] f longlist[2:1 Index Slicing with Range 9 longlist[2:51 h longlist[5:21 i longlist[8: i longlist19:1 Index Slicing using Negative Indices Klonglist[-9:1 longlist[-8:1 m longlist[-83-7) longlist[-1:] Other properties of Index Slicing o longlist[10:20] Plonglist[-7:51 Index Slicing with Step parameter 9 longlist: 11 longlist :21 s longlist[1:8:21 1 longlist[9:1:-1] u longlist[-1:11 V longlist(-10-11 3. Write your main observation about index slicing as a whole
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
