Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 1 0 Pts a ) What's the output of the following function, what will be the output 1 f arr 1 , 0 ,

(10 Pts
a) What's the output of the following function, what will be the output 1f arr 1,0,-5,6.
def func(arr):
a=0
b=0
c=0
for i in range(len(arr)):
if arr[i]>6 :
a+=1
elif arr [i] :
b+=1
elif arr[i]==0 :
ct=1
print(a/len(arr))
print (b/1en (arr))
print(c/len (arr))
func(arr)
b) What's the output of the following script.
D={1:[1,2,3],2:(4,6,8)}
D[1].append (4)
print , end =
L=1ist(0[2])
L. append(10)
D[2]=tuple(L)
print(D[2])
image text in transcribed

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

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

Describe infinite loading.

Answered: 1 week ago