0% found this document useful (0 votes)
38 views2 pages

Ex 3 and 4

Uploaded by

lomoy64997
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Ex 3 and 4

Uploaded by

lomoy64997
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

3. Read N numbers from the console and create a list.

Develop a program to print mean,


variance and standard deviation with suitable messages.
import numpy as np

lst = []

n = int(input('Enter number of elements : '))

print('Enter the elements : ')

for i in range(0, n):

ele = float(input())

lst.append(ele)

print(lst)

mean=np.mean(lst)

var=np.var(lst)

std=np.std(lst)

print('Mean=',mean)

print('Variance=',var)

print('Standard Deviation=',std)

4. Read a multi-digit number (as chars) from the console. Develop a program to print the
frequency of each digit with suitable message.
# Read a multi-digit number (as chars) from the console.
# Develop a program to print the frequency of each digit with suitable message.
import pprint
n =int(input('Enter a Multi digit number '))
n=str(n)
count={}
for character in n:
count.setdefault(character,0)
count[character]+=1
pprint.pprint(count)

You might also like