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=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) |
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
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) |
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=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") |
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
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) |
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
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): |
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
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) |
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
#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**") |
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
#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') |
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) |