Skip to content

Instantly share code, notes, and snippets.

View ImOmkar's full-sized avatar
:octocat:
Committing

Omkar Parab ImOmkar

:octocat:
Committing
View GitHub Profile
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)
@ImOmkar
ImOmkar / countvowels.py
Created August 18, 2018 17:39
WAP to check whether the string is starting with vowel or not.
#WAP to count the total number of vowel in a string
user=input("Enter: \n")
vowels=0
vowels+=user.count('a')
vowels+=user.count('e')
@ImOmkar
ImOmkar / upperlower.py
Created August 18, 2018 17:31
WAP to take string as a input and check if the string is in uppercase or lowercase.
#WAP to take string as a input and check if the string is in uppercase or lowercase
user=input("Enter a string: \n")
if(user.isupper()):
print("Entered string is in uppercase")
elif(user.islower()):
print("Entered string is in lowercase")
else:
print("**NOW GET LOST**")
@ImOmkar
ImOmkar / gssalary.py
Created August 16, 2018 18:53
Program to calculate gross salary in python
bs=float(input("Enter your basic salary :\n"))
da=bs*0.6
hra=bs*0.15
gs=bs+da+hra
print("Your Gross Salary is: ",gs)
@ImOmkar
ImOmkar / mrpdiscount.py
Created August 16, 2018 18:50
Program to calculate Discount on MRP in Python
u=int(input("Enter MRP:\n"))
o=int(input("Enter offer no:\n"))
for i in range(1):
if(o==1):
print("MRP Price after applying Discount: ",u*0.75)
elif(o==2):
print("MRP price after applying Discount: ",u*0.6)
elif(o==3):
@ImOmkar
ImOmkar / simpleinterest.py
Created August 16, 2018 18:45
Proogram to calculate simple interest in Python
p=float(input("Enter the Ammount :\n"))
r=float(input("Enter the Rate :\n"))
n=float(input("Enter the Duration :\n"))
simple_interest=(p*n*r)/100
print("Your Simple Interest Is :",simple_interest)
@ImOmkar
ImOmkar / evenodd.py
Created August 16, 2018 18:43
Check whether the number is even or odd.
n=int(input("Enter the number :\n"))
if(n%2==0):
print("The number",n,"is Even number")
else:
print("The number",n,"is Odd number")
@ImOmkar
ImOmkar / factorial.py
Created August 16, 2018 18:39
Program to find factorial of a given number
fact=1
num=int(input("Enter the number")) #input from user, and type is integer.
for i in range(1,num+1):
fact=fact*i
print("Factorial of a number",num,"is",fact)
@ImOmkar
ImOmkar / divisibleby7.py
Last active August 16, 2018 18:35
Printing the numbers which are divisible by 7, in the range from 1 to 300 in Python!
n=int(input("enter n numbers")) #input taken from user, with the type Integer
for i in range(1,301): #1 is the start, and 301 is the last value
if(i%7==0):
print(i)