Sunday, January 31, 2021
Friday, January 29, 2021
Thursday, January 28, 2021
Saturday, January 16, 2021
Python program for finding whether the given number is an odd or an even number
n = int(input("Enter a number:"))
if n % 2 == 0:
print(n, "is an even number")
else:
print(n, "is an odd number")
Python code for finding net salary
sal = float(input("Enter salary:"))
exp = int(input("Enter work experience:"))
grade = input("Enter grade:")
if(exp>=15):
if(grade == 'A' or grade == 'a'):
ns = sal * 2
elif(grade == 'B' or grade == 'b'):
ns = sal * 1.75
elif(grade == 'C' or grade == 'c'):
ns = sal * 1.50
else:
print("Invalid Input")
elif(exp >= 10 and exp < 15):
ns = sal * 1.50
elif(exp >= 5 and exp < 10):
ns = sal * 1.40
else:
ns = sal * 1.25
print("Net Salary:", ns)
Friday, January 8, 2021
Python code for merging first name, middle name, & last name
fname=input("Enter First Name:")
mname=input("Enter Middle Name:")
lname=input("Enter Last Name:")
fullname=fname+mname+lname
print(fullname)
Python code for simple operational calculator
First Method:
n1=float(input("Enter number1:"))
n2=float(input("Enter number2:"))
sign=input("Enter sign:")
if sign=='+':
print("Answer=",n1+n2)
elif sign=='-':
print("Answer=",n1-n2)
elif sign=='*':
print("Answer=",n1*n2)
elif sign=='/':
print("Answer=",n1/n2)
else:
print("Invalid sign")
Second Method:
n1=float(input("Enter number1:"))
n2=float(input("Enter number2:"))
sign=input("Enter sign:")
if sign=='+':
n=n1+n2
elif sign=='-':
n=n1-n2
elif sign=='*':
n=n1*n2
elif sign=='/':
n=n1/n2
else:
print("Invalid sign")
print("Answer=",n)
Thursday, January 7, 2021
Python code for finding greater number
v1=int(input("Enter value1:"))
v2=int(input("Enter value2:"))
if(v1>v2):
print("value1 is greater")
else:
print("value2 is greater")
Python code for student result system
roll_no=input("Enter roll number:")
name=input("Enter name:")
city=input("Enter city:")
eng=int(input("Enter English Marks:"))
maths=int(input("Enter Maths Marks:"))
sci=int(input("Enter Science Marks:"))
total=eng+maths+sci
average=total/3
print("Roll Number:",roll_no)
print("Name:",name)
print("City:",city)
print("English Marks:",eng)
print("Maths Marks:",maths)
print("Science Marks:",sci)
print("Total Marks:",total)
print("Average:",average)
Python code to find the amount of seconds
days=int(input("Input Days:")) * 3600 * 24
hours=int(input("Input Hours:"))*3600
minutes=int(input("Input Minutes:"))*60
seconds=int(input("Input Seconds:"))
time=days+hours+minutes+seconds
print("The amounts of seconds", time)
Everyone Is Fighting a Battle You Can't See ❤️ | A Simple Reminder to Be Kind
Hi, namaste Krishna. So today we will be talking about that everyone is going through something in their life. Be it you, be it your friend...
-
Quote 8: The road to great dreams passes through great failure. Quote 7: Protect your peace, master your mind, and trust the process. 🎯 Quo...
-
Hello first of all a very happy brothers day to all the lovely brothers out there. I would like to share a story that recently occured to m...