Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Refer to the following two lists for this question: List A: 23,2,3,42,3,6 List B: 5,3,6,3,9 Write the codes: a) to identify the position of integer

Refer to the following two lists for this question: List A: 23,2,3,42,3,6 List B: 5,3,6,3,9

Write the codes:

a) to identify the position of integer "42" from the list A. (5 marks)

b) to display the occurrences of each integer from list A. (8 marks)

c) to perform an average of the numbers in List A. (2 marks)

d) to perform an average of the numbers in List B. (2 marks)

e) to compare both average of list A and list B. If average value of list A is less than the one from list B, display a message error "An error happens as list A is larger than list B". (3 marks)

f) to compare list A with list B, to identify common integers and list them on the screen. (5 marks

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

Transport Operations

Authors: Allen Stuart

2nd Edition

978-0470115398, 0470115394

Students also viewed these Programming questions

Question

1.Q-2 How does a shadow price differ from a normal price?

Answered: 1 week ago