Created
August 26, 2018 01:43
-
-
Save ImOmkar/457e8f429372002d818a21a7f69b6937 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L=['Apple','Mango',2,4.5,6,2,'Apple',2,4.5,'Apple'] | |
occur = L.count('Apple') | |
occur1 = L.count('Mango') | |
occur2 = L.count(2) | |
occur3 = L.count(4.5) | |
occur4 = L.count(6) | |
print("Apple\t: ",occur) | |
print("Mango\t: ",occur1) | |
print("2\t: ",occur2) | |
print("4.5\t: ",occur3) | |
print("6\t: ",occur4) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L=['Mango','Grapes','Mango','Apple','Grapes','Grapes'] | |
word_list=[] | |
count_list=[] | |
L2=list(set(L)) | |
L2.sort() | |
for each in L2: | |
#if each not in word_list: | |
word_list.append(each) | |
#word_list.sort() | |
count_list.append(L.count(each)) | |
#count_list.sort() | |
print("word_list =",word_list) | |
print("count_list =",count_list) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L=['Apple','Mango',2,4.5,6,2,'Apple',2,4.5,'Apple'] | |
occur = L.count('Apple') | |
occur1 = L.count('Mango') | |
occur2 = L.count(2) | |
occur3 = L.count(4.5) | |
occur4 = L.count(6) | |
print("Apple\t: ",occur) | |
print("Mango\t: ",occur1) | |
print("2\t: ",occur2) | |
print("4.5\t: ",occur3) | |
print("6\t: ",occur4) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L=['Mango','Grapes','Mango','Apple','Grapes','Grapes'] | |
word_list=[] | |
count_list=[] | |
L2=list(set(L)) | |
L2.sort() | |
for each in L2: | |
#if each not in word_list: | |
word_list.append(each) | |
#word_list.sort() | |
count_list.append(L.count(each)) | |
#count_list.sort() | |
print("word_list =",word_list) | |
print("count_list =",count_list) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num=int(input("enter range: \n")) | |
empty=[] | |
for n in range(num): | |
numbers=int(input("enter the numbers:" )) | |
empty.append(numbers) | |
print("Greatest number is:",max(empty)) | |
print("Smallest number is",min(empty)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n_numbers=int(input("Enter the range: \n")) | |
empty=list() | |
for i in range(n_numbers): | |
numbers = int(input()) | |
empty.append(numbers) | |
print(empty) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user_input=int(input("enter the range: \n")) | |
empty=list() | |
for i in range(user_input): | |
user_finput=float(input()) | |
empty.append(user_finput) | |
total=0 | |
for i in empty: | |
total=total+i | |
round(total, 2) | |
print("Total: \n",total) | |
mean=total/user_input | |
round(mean, 2) | |
print("Mean: \n",mean) | |
percentage=mean/total*100 | |
round(percentage, 2) | |
print("Percentage: \n",percentage) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment