Question: 6. Write a conditional statement if else) which checks the first element in a list index zero) and assign answer 1 to 'Yes' if the


6. Write a conditional statement if else) which checks the first element in a list index zero) and assign answer 1 to 'Yes' if the first element is equal to strawberry else it should assign answer 1 to "No". In 1 1: Ist=["Mango", "Kiwi", "Melon", "Cherry" answer_1 #Type your code here print (answer 1) 47. len function can also tell the length of a string. Find out the length of the string given below. In [ 1: msg="Be yourself, everyone else is taken." #Type your code here. msg_length=len (D) print(msg_length) 45. Sort the keys of the dictionary from a to z. Hint: You might want to create a list of the keys first with the help of a dictionary method. In : dict:{"tiramisu":5, "chocolate":2,"pudding":3, "cheesecake":4) # Type your code below. key_list print(key_list)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
