Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

answer this thanks 1. LIST (the values are represented in [ ]). Study this code: def list_demo(): my_list = [64, 'hello', 105.7, '', [0,1,2], False]

answer this thanks
image text in transcribed
1. LIST (the values are represented in [ ]). Study this code: def list_demo(): my_list = [64, 'hello', 105.7, '', [0,1,2], False] print('la. ', my_list(2:43) print('1b. ', my_list [4] [2]) my_list[3] = True print('lc. ', my_list) print('id. ', my_list(-1]) my_list.append(True) print('le. ', len(my_list)) print('if. '; my_list[4:6] + ['2014/11/06', 5]) my_list.extend('2014/11/06'.split('/')) print('lg. ', len(my_list)) my_list = my_list + (105.7, False, list('abc'), ''] my_list.remove(105.7) print('1h. ', my_list) print('li. ', len(my_list)) print('lj. ', my_list. index (True)) Step 1. Predict the output of this code. Write down what each line does. Make sure you number each line with your answer. Don't worry about making mistakes, it is part of the learning process. Don't run the code yet. Step 2. Type the code into a file named task01.py. Run the code. Attach a screenshot of your code and answer. Step 3. Explain any discrepancies between your predictions and the actual output. Write down where you made the mistakes and what you understood after obtaining the answer. Number the lines where the mistakes are made with your reasoning

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions