print('Exercise') a = int(input("Enter a number")) b = int(input('Enter a number')) print('Which operation do you perform, If you want to perform print 1 for addition , 2 for subtraction 3 for multiplication 4 for division and 5 for floor division 6 for exponential form 7 for the remainder . While looking the answers remember that all things consider a first ') d= int(input('Enter any of the above numbers ')) if d==1: print("The sum of the number is ",a+b) elif d==2: print("The subtractation of the numbers is ",a-b) elif d==3: print("The product of the numbers is ",a*b) elif d==4: print("The division quotient of the number is",a/b) elif d==5: print("The floor division of the number is ",a//b) elif d==6: print("The exponential form of the number is ",a**b) elif d==7: print("The remainder of the numbers is ",a%b) elif d==0: print("The option does not exist") elif d>7: print('It seems that you have chosed incorrect option') print("Thank you for using my calculator")
a = int(input("entre your 1 no ")) b = int(input("entre your 2 no ")) print ("addition of a and b") print(a + b) print ("subtraction of a and b") print (a - b) print ("multiplication of a and b") print (a*b) print("division of a and b") print (a/b) print ("flot division of a and b") print (a//b) print("modulo of a and b") print (a%b) print ("thank you for this 100 days course of python")
print("Hello sir") a=int(input("Entre a first number")) b=int(input("Entre a second number")) print("The sum is=",a+b ) print("The Subtraction is=",a-b) print("The multiplication is=",a*b) print("The division is=",a/b) print("The mode is =", a%b)
You can use the if and elif to show only the result of one by making an operator variable which takes operators as input and then use the if and elif functions to show only the result that the client is asking for not all at once
def Calculator(choice,a,b): if choice==1: print("the sum is :") return a+b if choice==2: print("the difference is :") return a-b if choice==3: print("the multiplication is :") return a*b if choice==4: print("the division is :") return a/b if choice==5: print("the modulo is :") return a%b else: return "wrong choice"
choice=int(input("Enter the user's choice : ")) a=int(input("enter the 1st number :")) b=int(input("enter the 2nd number :")) res=Calculator(choice,a,b) print(res) This code is better than urs
Day 8 present, consistency ✌️(start se consistency laga ra hu tho present laga k flow break nai kar sakta 😅) ..and I am eagerly waiting for Day 9 and tough exercises in future 💪.. love you Harry Bhai ❤️
print("calculator") a=float (input('please enter the value of a =')) b=float (input('please enter the value of b =')) print("addition =", a+b) print("subtraction =", a-b) print("multiplication =", a*b) print("division =", a/b)
num1= input("Enter the 1st number:") num2= input("Enter the 2nd number:") num1=int(num1) num2=int(num2) print("The addition of the numbers=",num1+num2) print("The subtraction of the numbers=",num1-num2) print("The division of the numbers=",num1%num2) print("The multiplication of the numbers=",num1*num2) print("The mode of the numbers=",num1/num2) print("Thank you for choosing this calculator!!")
Bhaiya mere pass PC nahi hai to maine apna program mobile mai likh ke run kiya hai.. Thank you bhaiya aap bohot achhha padhate hai. Aur isse pehle maine koi program nahi likha tha apni life mai khud se but aaj maine pehla program likha other than hello world aur mughe bohot khushi bohot khushi bohot khusii ho rahi hai, thank you bhaiya print("****Addition of Two Numbers****") a =int(input("Enter the number 1:")) b =int(input("Enter the number 2:")) add = a+b print("Addition of numbers are" ,add) print("****Substraction of Two Numbers****") c =int(input("Enter the number 1:")) d= int(input("Enter the number 2:")) sub = c-d print("Substraction of numbers are" ,sub) print("****Multiplication of Two Numbers****") e =int(input("Enter the number 1:")) f =int(input("Enter the number 2:")) mul =e-f print("Multiplication of numbers are" ,mul) print("*****Division of Two Numbers****") g =int(input("Enter the number 1:")) h =int(input("Enter the number 2:")) div =g/h print("Division of Numbers are" ,div)
well, I did it quite different. I did it as a = 15 b = 12 c = a + b d = a - b e = a * b f = a / b g = a % b h = a ** b i = a // b print("The addition of", a,"+",b,"is", c)
@@GoluRajput-h1u but he didnt teached input yet, he meant it as idle based not in console based so this is the right one, those were either gpt scripted or by the people who've learned python before too
a=int(input("Enter the value of a = ")) b=int(input("Enter the value of a = ")) print("a+b =", a+b) print("a-b =", a-b) print("a*b =", a*b) print("a/b =", a/b) print("a Percentile b", a%b)
a = int(input("enter first number")) b = int(input("enter secod number")) print(a + b) print(a - b) print(a * b) print(a / b) print ("thank you for this 100 days course of python")
a=float(input("Entre first number = ")) b=float(input("Entre second number = ")) print("The sum is=",a+b ) print("The Subtraction is=",a-b) print("The multiplication is=",a*b) print("The division is=",a/b) print("The mode is =", a%b)
a = int(input("enter the first number:")) b= int(input("enter the second number:")) c= input("enter the operation to be performed:") if c== "addition": print (a+b) elif c == "subtraction": print(a-b) elif c == "multiplication": print(a*b) elif c=="division": print(a/b) else: print("operation not applicable")
print("This is a calcuator.") a = int(input("Enter first num")) c = str(input("+ - * /")) b = int(input("Enter second num")) if c == "+": print(a+b) elif c == "-": print(a-b) elif c == "/": print(a/b) elif c == "*": print(a*b)
a=int(input("Type the first number")) b=int(input("Type the second number")) print("the sum of the two numbers is : " , a+b) print("the difference of two numbers is : " , a-b) print("the product of two numbers is " , a*b) print("the quotient of two numbers is " , a/b)
I'm Present Sir . 05th December 2022 Monday 04:40 pm PST Respect and love for you Harry bhai from Pakistan . You're a great and sincere teacher . May Allah Pak bless you Sir Haris Ali Khan Sahab
A = VALUE B = VALUE print ("addition of two value is ", A+B) print ("SUBTRACTION of two value is" , A-B) print ("MULTIPLICATION of two value is" ,A*B) print ("DIVISION of two value is" , A/B) print ("EXPONENT of two value is" , A**B)
Here are some Repl based shortcuts Run repl. ctrl + enter. Open shell. ctrl + shift + s. open preferences. ctrl + , Open version control sidebar. ctrl + shift + g. open debugger. ctrl + shift + d. toggle command bar. ctrl + . Open multiplayer mode. ctrl + shift + m. Open packages sidebar. ctrl + shift + L.
a=10 b=6 print("Welcome To The Calculator") # To add the numbers print("The sum of the given number is: ",a+b) # To subtract the numbers print("The difference of the given number is: ",a-b) # To multiply the numbers print("The product of the given number is: ",a*b) # To divide the numbers print("The divison of the given number is: ",a/b) # To find remainder the numbers print("The remainder of the given number is: ",a%b) print("Thanks For Using..") ]
Harry Bhaiya thank you for all ur free courses and I am getting very much help learning new skills from you and again thank you bhaiya for making us uprade in coding skills 😇
Well for those who are just starting def add (x,y): return x+y def subtract (x,y): return x-y and so on it is much easier to do it like this and it runs faster
print("welcome to the calculator select number according to the operation ") print("1:-Sum 2:-Substact 3:-multiply 4:-divide") userpass = int(input()) print(userpass) if (userpass < 5) : print("enter your first number") a=int(input()) print("enter your second number") b=int(input()) match userpass: case 1: print(a + b); case 2: print(a - b); case 3: print(a * b); case 4: print(a / b); case other: print("select valid number") else: print("select out 4 number pleases")
Going to be honest here, I brainstormed till headache as to how can i make a code in which i give an option to input a number to the user, but with the 7 videos of knowledge how could i have done that 😅 So thank you harry bhaiya for your morale support in each and every video,❤
same bro brainstormed so much and felt sad for not knowing how to do that floating thing, its completely fine right if we just use the numbers he gave in previous one and create a normal "so called" calculator right ?, we'll be knowing all this in upcoming videos right ?? @@Stoiczons
a = int(input("Entre first no : ")) b = int(input("Entre second no : ")) print("operations on two operands are ") print("addition",a+b) print("subtraction",a-b) print("multiplication",a*b) print("divison",a/b) print("floor division ",a//b) print("reminder",a%b)
I felt a bit nervous as I hadn't complete the 1st task given by you but I will continuing with your educational videos. I'm working with an NGO and in free time watched your videos to learn something new. Thanks a lot bro.
a = 56 b = 45 print("The number of sum", a+b) print("The number of subtraction", a - b) print("The number of multiplication", a * b) print("The number of division", a / b) print("The number of floor division", a // b) print("The number of exponential", a ** b)
a=4 b=6 print("Addition of 'a' and 'b' is: ",a+b) print("Subtraction of 'a' and 'b' is: ",a-b) print("Multiplication of 'a' and 'b' is: ",a*b) print("Division of 'a' and 'b' is: ",a/b) print("Modulus(Remainder) of 'a' and 'b' is: ",a%b) print("Exponentiation of 'a' and 'b' is: ",a**b) print("Free division of 'a' and 'b' is: ",a//b) A simple calculator
I did it without using input a=value b=value print ("Addition of two values is",a+b) print("Subtraction of two values is",a-b) print("Product of two values is",a*b ) print("Quotient of two values is",a/b) print("Remainder of two values is",a%b) print("Exponent of two values is",a**b)
value1=2 value2=3 a=value1 b=value2 print ("Addition of two values is",a+b) print("Subtraction of two values is",a-b) print("Product of two values is",a*b ) print("Quotient of two values is",a/b) print("Remainder of two values is",a%b) print("Exponent of two values is",a**b) # now it will work.....
a = 3 b = 5 c = a + b d = a - b e = a / b f = a * b print(c) print(ad) print(e) print(f)a = 3 b = 5 c = a + b d = a - b e = a / b f = a * b print(c) print(ad) print(e) print(f)
But thnxs alot for this series because of this i am now consistent on my coding even without having a pc. I go to library bcoz they have computers for everyone use or use my smart tv connected with wireless keyboard and mouse for using replit and do coding. Hope to finish 100 days and be with you always.
print("following are all opration of calculator:") a=input("enter a first number =") b=input("enter a second number=") c=float(a)+float(b); print("the sum of {0} and {1} is {2}".format(a,b,c)) d=float(a)-float(b) print("the sub of {0} and {1} is {2}".format(a,b,d)) e=float(a)*float(b) print("the sub of {0} and {1} is {2}".format(a,b,e)) f=float(a)/float(b) print("the sub of {0} and {1} is {2}".format(a,b,f)) g=float(a)%float(b) print("the sub of {0} and {1} is {2}".format(a,b,g))
hello harry bhai is code me koi bhi error nhi arha ha per 3rd input se age nhi ja rha ha . print("hello this is a pahadi calculater") A = float(input("pela number pa:")) B = float(input("apna dursa number pa:")) i = float(input("1 type kera ager jodna ha 2 type kera agerghatana ha 3 type kera ager gudna kerna ha 4 ager vibhajit kerna ha apna operater select kera:")) if i== 1: print = ("apka utter ha : ", A + B) elif i== 2: print = ("apka utter ha : ", A - B) elif i== 3: print = ("apka utter ha : ", A * B) elif i== 4: print = ("apka utter ha : ",A / B) else : print = ("error detected")
print("""It's is a calculater for all basic mathamatics tools like :- Addition , substraction , Division , multiplication and Greatest Integer of division of any Number""") A = int(input("Enter your first Digit = ")) B = int(input("Enter Your second Digit = ")) print("Addition is = " , (A+B) ) print("Substraction is", (A-B)) print("multiplication is " , (A*B)) print("division is " , (A/B)) print("Greatest Integer is", (A//B))
# I have Made this as a new try: print("1.Table 2.Multiplication 3.Subtraction 4.Divide 5.Addition 6.Square 7.Cube") q = input("What do you want?. Type a value of it: ") if q == '1': tablenum = int(input("which table you want?: ")) table1 = int(input("x x y = x: type your y: ")) print("
") for table1 in range(table1 + 1): print(f"{tablenum} x {table1} = ", table1 * tablenum) elif q == '2': j = input("decimal or round - d or r: ") if j == 'r': g = int(input("Write your 1st number: ")) h = int(input("Write your 2nd number: ")) elif j == 'd': g = float(input("Write your 1st number: ")) h = float(input("Write your 2nd number: ")) print((f"{g} x {h} = ",g*h)) else: print("sorry!!") elif q == '3': sub1 = int(input("Type your first number: ")) sub2 = int(input("Type your second number: ")) print(f"{sub1} - {sub2} =", sub1-sub2) elif q == '4': div1 = int(input("Type your first number: ")) div2 = int(input("Type your second number: ")) divq1 = input("Do you want it in round - y or n: ") if divq1 == 'y': round_a = round(div1/div2) print(f"{div1} / {div2} =", round_a) elif divq1 == 'n': print(f"{div1} / {div2} =", div1/div2)
else: print("sorry!!") elif q == '5': add1 = int(input("Type your first number: ")) add2 = int(input("Type your second number: ")) print(f"{add1} + {add2} =", add1+add2)
elif q == '6': sq = int(input("Type number you want to have his square: ")) print(f"Square of {sq} is:", sq*sq) elif q == '7': cb = int(input("Type number you want to have his cube: ")) print(f"Square of {cb} is:", cb*cb*cb) else: print("Sorry!!") except: print("Sorry!!")
a=int(input("Enter First number:")) b=int(input("Enter Second number:")) add=a+b sub=a-b mul=a*b div=a/b print("Addition of First and Second number is",add) print("subtraction from First number to Second number is", sub) print("product of first and second number is", mul) print("Division of First number by second number is", div)
import math def add(a, b): return a + b def subtract(a, b): return a - b def multiply(a, b): return a * b def divide(a, b): if b == 0: raise ValueError("Division by zero is not allowed.") return a / b def power(a, b): return a ** b def root(a, b): if b == 0: raise ValueError("Root with exponent 0 is not defined.") return a ** (1 / b) def square(a): return a ** 2 def cube(a): return a ** 3 def sqrt(a): if a < 0: raise ValueError("Square root of a negative number is not defined.") return math.sqrt(a) def cbrt(a): return math.pow(a, 1 / 3) def log(a, b): if b
L1 = ["addition", "subtraction", "multiplication", "division", "modular division", "integer division", "exponentiation"] a = int(input("Enter first number ")) b = int(input("Enter second number ")) print("The options are ",L1) c = input("What operation do you want to do ") while c not in L1: print("The operation is not in List") c = input("So, Enter the name of operation. ") c = c.lower() def add(x, y): z = x + y return z def subtract(x, y): z = x - y return z def divide(x, y): z = x / y return z def multiply(x, y): z = x * y return z def modular(x, y): z = x % y return z def integer(x, y): z = x // y return z def exponentiation(x, y): z = x ** y return z if c == "addition" : result = add(a, b) elif c == "subtraction" : result = subtract(a, b) elif c == "multiplication" : result = multiply(a, b) elif c == "division" : result = divide(a, b) elif c == "modular division": result = modular(a, b) elif c == "integer division": result = integer(a, b) elif c == "exponentiation": result = exponentiation(a, b) print (result)
Thanks alot Harry sir. So many people in Pakistan praise the way you teach so nicely. and your way of explanation is great. It's great that you are teaching things from scratch, I was totally new in python
@@elon7385 oh kuttay, your religion is more old then 1500, wese bhi parhne toh muslim se aai ho, harry is muslim, india me agay muslims hein, chahy woh bollywood ho ya yeh youtube
n=int(input()) m=int(input()) print("add of the two number: ", n+m) print("subtract of the two number: ",n-m) print("multiplication of the two number: ",n*m) print("division of the two number :",n/m) print("modulus of the two number: ",n%m) print("folor division of two number :",n//m)
Attendence Day 8 #100dayscodingchallenge #python #codeWithHarry❤Enjoying the course Thanks for teaching us from the heart with humbleness ,values & great efforts bhai❤ time : - 23:59
yes 😂 jo study kr rha hai is field me usko to samaj ayega kese creat krna hai but me to pharmacy kiya hua banda hoon kuch palle nai pada kese creat krna hai woh😂
Yeah bro I'm science student in 11th this is my first programming language I understand everything but I didn't know how to apply it and where do I can apply it.🥲
a=45 b=35 ans1= a+b print('addition of two numbers is '+ str(ans1)) ans2=a-b print('subtraction of two numbers is '+ str(ans2)) ans3=a*b print('multiplication of two numbers is '+ str(ans3)) ans4=a/b print('division of two numbers is '+ str(ans4))
mujhe pata hai ke mein 1 saal late hun lekin mujhe begginer programs banane aate hain lekin ye wala jo bande start se python skh rahen un ke liye bohot mushkil hai
Num1=int(input("enter the number:")) Num2=int(input("enter the number:")) add=Num1+Num2 mul=Num1*Num2 div=Num1/Num2 sub=Num1-Num2 floor=Num1//Num2 exponention=Num1**Num2 print("Addition of number is",add) print("Subtraction of number is",sub) print("Multiplication of number is",mul) print("Division of number is",div) print("Floor division of number is",floor) print("Exponention of number is ",exponention)
class FirstClass{ public static void main(String[] args){ System.out.println("What Is Your Name"); Scanner sc = new Scanner(System.in); String name sc.next(); System.out.println("Hell" + name + "great job"); } } भाई मेरा ये कोड run नहीं कर रहा please help करो क्या problem हैं इसमें
print("This is a calcuator.") a=int(input("Enter the first number")) b=int(input("Enter the second number")) c=str(input("Enter the operater,(+ - * /):")) if c=="+": print("the sum of the numbes is",a+b) elif c=="-": print("the difference between the numbers is ",a-b) elif c=="/": print("the quotient of the numbers is ,",a/b) elif c=="*": print("the product of the numbers is",a*b) else: print("invalid input")
# I have Made this as a new try: print("1.Table 2.Multiplication 3.Subtraction 4.Divide 5.Addition 6.Square 7.Cube") q = input("What do you want?. Type a value of it: ") if q == '1': tablenum = int(input("which table you want?: ")) table1 = int(input("x x y = x: type your y: ")) print("
") for table1 in range(table1 + 1): print(f"{tablenum} x {table1} = ", table1 * tablenum) elif q == '2': j = input("decimal or round - d or r: ") if j == 'r': g = int(input("Write your 1st number: ")) h = int(input("Write your 2nd number: ")) elif j == 'd': g = float(input("Write your 1st number: ")) h = float(input("Write your 2nd number: ")) print((f"{g} x {h} = ",g*h)) else: print("sorry!!") elif q == '3': sub1 = int(input("Type your first number: ")) sub2 = int(input("Type your second number: ")) print(f"{sub1} - {sub2} =", sub1-sub2) elif q == '4': div1 = int(input("Type your first number: ")) div2 = int(input("Type your second number: ")) divq1 = input("Do you want it in round - y or n: ") if divq1 == 'y': round_a = round(div1/div2) print(f"{div1} / {div2} =", round_a) elif divq1 == 'n': print(f"{div1} / {div2} =", div1/div2)
else: print("sorry!!") elif q == '5': add1 = int(input("Type your first number: ")) add2 = int(input("Type your second number: ")) print(f"{add1} + {add2} =", add1+add2)
elif q == '6': sq = int(input("Type number you want to have his square: ")) print(f"Square of {sq} is:", sq*sq) elif q == '7': cb = int(input("Type number you want to have his cube: ")) print(f"Square of {cb} is:", cb*cb*cb) else: print("Sorry!!") except: print("Sorry!!")
a = int(input("Enter Number")) b = int(input("Enter Number")) c = int(a+b) d = int(a-b) e = int(a*b) f = int(a/b) g = int(a // b) h = int(a%b) i = int(a**b) print(c) print(d) print(e) print(f) print(g) print(h) print(i)
#my calculator thank you sir for teaching x = input("enter equation here =") Result = eval(x) try: print("result =",Result) print("Thanks for using our calculator") except ValueError: print("Enter a valid chracter")
num1 = float(input("Enter the 1st value: ")) num2 = float(input("Enter the 2nd value: ")) print("""choice operation which you want additon: 1 substraction: 2 division: 3 multiplilcation: 4 """) operation = int(input("enter which type of operation you wnat: ")) if operation == 1: print("sum of two numbers: " , num1 + num2) if operation == 2: print("differnce of two numbers: " , num1 - num2) if operation == 3: print("division of two numbers: " , num1 / num2) if operation == 4: print("multiplication of two numbers: " , num1 * num2)
#asking for nummbers a=input("type your first number ") b=input("type your seacond number ") #asking what user wanna do c=input("What you want to do your options are: + - * / chose the one option ") #Checking what the user chose if c=="+": print(int(a)+int(b)) elif c=="-": print(int(a)-int(b)) elif c=="*": print(int(a)*int(b)) elif c=="/": print(int(a)/int(b))
print ("Calculator") a = int(input("Enter the first number: ")) b = int(input("Enter the second number: ")) print("To add type 1") print("To subtract type 2") print("To multiply type 3") print("To divide type 4") c = int(input("Enter the number: ")) if c ==1: print("The sum of the numbers is",a+b) elif c==2: print("The subtraction of the numbers is",a-b) elif c==3: print("The multiplication of the numbers is",a*b) if b==0 and c == 4: print ("not defined") elif c==4: print("The division of the numbers is",a/b) else: print("Please check your input value")
def Calculator(choice,a,b): if choice==1: print("the sum is :") return a+b if choice==2: print("the difference is :") return a-b if choice==3: print("the multiplication is :") return a*b if choice==4: print("the division is :") return a/b if choice==5: print("the modulo is :") return a%b else: return "wrong choice"
choice=int(input("Enter the user's choice : ")) a=int(input("enter the 1st number :")) b=int(input("enter the 2nd number :")) res=Calculator(choice,a,b) print(res)
#calculator a=int(input("enter a number")) b=int(input("enter another number")) C=input("enter your choice") If C=="+": Print(a+b) Elif C=="-": Print(a-b) Elif C=="×": Print(a×b) Elif C=="/": Print(a/b) Else: Print("entered choice not available ")
a=int(input("enter the 1st number:")) b=int(input("enter the 2nd number:")) print("the value of",a,"+",b,"is :",a+b) print("the value of",a,"-",b,"is :",a-b) print("the value of",a,"*",b,"is :",a*b) print("the value of",a,"/",b,"is :",a/b)
#variables a = 5 b = 10 c = 15 d = 20 e = 25 # operations add = a+b sub = c-b mul = c*d div = e/a exp = a**b floordiv = e//d modulus = e%a #output print("Addition of a and b : ", add) print("Subtraction of b and c: ", sub) print("Multiplication of c and d: ", mul) print("Division : of e and a", div) print("Exponentiation of a and b: ", exp) print("Floor Division : of e and d :", floordiv) print("Modulus : of e and a :", modulus)
a = int(input("enter your number here:\t")) b = int(input("enter you second number here:\t")) print("add the above numbers\t----------->", a+b) print(f"subtract the above number\t---> {a-b}") print(f"divide the above number\t----------> {a/b}") print(f"multiply th above numbers\t---> {a*b}")
print("welcome to calculator") a = float(input("what is the first no. ?")) b = float(input("what is the second no. ?")) answer1 = a+b print("the addition is ", answer1) answer2 = a-b print("the subtraction is ", answer2) answer3 = a*b print("the multiplication is ", answer3) answer4 = a/b print("the division is ", answer4) answer5 = a**b print("the power is ", answer5) answer6 = a//b print("the floor division is ", answer6) answer7 = a%b print("the module is ", answer7)
The addition of 12 and 14 is 26 The subtraction of 12 and 14 is -2 The multiplication of 12 and 14 is 168 The divison of 12 and 14 is 0.8571428571428571 The absolute of 12 and 14 is 12
a = 10 b = 8 add = a + b sub = a - b multiply = a * b divide = a / b floordivide = a // b exponential = a ** b modulus= a % b print("addition of",a,"and",b,":",add) print("subtraction of",a,"and",b,":",sub) print("multiplication of",a,"and",b,":",multiply) print("division of",a,"and",b,":",divide) print("floor division of",a,"and",b,":",floordivide) print("exponential of",a,"and",b,":",exponential) print("modulus of",a,"and",b,":",modulus)
Its day 8th but for me its day 2 nd but I got my solution after seeing everyones but not copied You can have a look :- print("welcome to the calculator ") x=int(input("enter the first number:")) y=int(input("enter the second number ")) a=x+y b=x-y c=x*y d=x/y print("For subtraction, multiplication and division press enter ") input(a) input(b) input(c) input(d) print ("the sum of the two numbers is",a) print ("the difference between two numbers is",b) print("the product of the two numbers is ",c) print("the quotient of the two numbers is",d) I know its kinda small and not like calculator but by watching only few videos I think its pretty nice ❤😅
c = input (" what you have to do") b = input("the second number")
if c == '+': print ('the final result is',int(a) + int(b))
elif c == '-': print ('the final result is',int(a) - int(b))
elif c == '*': print ('the final result is',int(a)* int(b)) elif c == '/': print ('the final result is',int(a) / int(b)) else: print('the input is invalid') break
#asking for nummbers a=input("type your first number ") b=input("type your seacond number ") #asking what user wanna do c=input("What you want to do your options are: + - * / chose the one option ") #Checking what the user chose if c=="+": print(int(a)+int(b)) elif c=="-": print(int(a)-int(b)) elif c=="*": print(int(a)*int(b)) elif c=="/": print(int(a)/int(b))
or like this x=int(input("Enter the value of a = ")) y=int(input("Enter the value of a = ")) print("x+y =", x+y) print("x-y =", x-y) print("x*y =", x*y) print("x/y =", x/y)
print("WELCOME TO THE CALCULATOR") a=int(input("Enter 1st number:")) b=int(input("Enter 2nd number:")) print("the ans is",a+b,"When addition") print("the ans is",a-b,"When Sub") print("the ans is",a*b,"When Multiplication") print("the ans is",a/b,"When Divions")
This is the simple calculator which performs addition , subtraction, division and multiplication for two numbers , without performing and showing all the operations in one go by using if else condition. you have to just input first number, second number and the operation vwhich you want to use, and then you'll get the result num1= float(input("Enter first number:")) num2= float(input("Enter second number:")) operator= input("Enter operator(+,-,/,*)") if operator == '+': result = num1+num2 print("result:",result) if operator == '-': result = num1-num2 print("result:",result) if operator == '*': result = num1*num2 print("result:",result) if operator == '/': result = num1/num2 print("result:",result) else: print("Invalid operation") hope you'll find it useful
print('Exercise')
a = int(input("Enter a number"))
b = int(input('Enter a number'))
print('Which operation do you perform, If you want to perform print 1 for addition , 2 for subtraction 3 for multiplication 4 for division and 5 for floor division 6 for exponential form 7 for the remainder . While looking the answers remember that all things consider a first ')
d= int(input('Enter any of the above numbers '))
if d==1:
print("The sum of the number is ",a+b)
elif d==2:
print("The subtractation of the numbers is ",a-b)
elif d==3:
print("The product of the numbers is ",a*b)
elif d==4:
print("The division quotient of the number is",a/b)
elif d==5:
print("The floor division of the number is ",a//b)
elif d==6:
print("The exponential form of the number is ",a**b)
elif d==7:
print("The remainder of the numbers is ",a%b)
elif d==0:
print("The option does not exist")
elif d>7:
print('It seems that you have chosed incorrect option')
print("Thank you for using my calculator")
a = int(input("entre your 1 no
"))
b = int(input("entre your 2 no
"))
print ("addition of a and b")
print(a + b)
print ("subtraction of a and b")
print (a - b)
print ("multiplication of a and b")
print (a*b)
print("division of a and b")
print (a/b)
print ("flot division of a and b")
print (a//b)
print("modulo of a and b")
print (a%b)
print ("thank you for this 100 days course of python")
shabashh...!!!!!
Excellent!! 👍🏻
But how do you know this, cuz in this course he has not taught this yet ?! Where did you learn this syntax?
@@zizouking10 My be he learnt from somewhere else earlier! "Honhaar Vidyarthi"
a= int(input("enter a number first"))
b= int(input("enter a number second"))
C =a+b
Print(c)
print("Hello sir")
a=int(input("Entre a first number"))
b=int(input("Entre a second number"))
print("The sum is=",a+b )
print("The Subtraction is=",a-b)
print("The multiplication is=",a*b)
print("The division is=",a/b)
print("The mode is =", a%b)
You can use the if and elif to show only the result of one by making an operator variable which takes operators as input and then use the if and elif functions to show only the result that the client is asking for not all at once
bro but he didnt teach that yet@@ashir...897
def Calculator(choice,a,b):
if choice==1:
print("the sum is :")
return a+b
if choice==2:
print("the difference is :")
return a-b
if choice==3:
print("the multiplication is :")
return a*b
if choice==4:
print("the division is :")
return a/b
if choice==5:
print("the modulo is :")
return a%b
else:
return "wrong choice"
choice=int(input("Enter the user's choice : "))
a=int(input("enter the 1st number :"))
b=int(input("enter the 2nd number :"))
res=Calculator(choice,a,b)
print(res)
This code is better than urs
@@mampilahiri3441 he hasn't taught us if,else conditions yet
@@riteshsharma6790 oh sorry , 😞 😔 😟
Day 8 present, consistency ✌️(start se consistency laga ra hu tho present laga k flow break nai kar sakta 😅) ..and I am eagerly waiting for Day 9 and tough exercises in future 💪.. love you Harry Bhai ❤️
Ll
print("calculator")
a=float (input('please enter the value of a ='))
b=float (input('please enter the value of b ='))
print("addition =", a+b)
print("subtraction =", a-b)
print("multiplication =", a*b)
print("division =", a/b)
num1= input("Enter the 1st number:")
num2= input("Enter the 2nd number:")
num1=int(num1)
num2=int(num2)
print("The addition of the numbers=",num1+num2)
print("The subtraction of the numbers=",num1-num2)
print("The division of the numbers=",num1%num2)
print("The multiplication of the numbers=",num1*num2)
print("The mode of the numbers=",num1/num2)
print("Thank you for choosing this calculator!!")
Bhaiya mere pass PC nahi hai to maine apna program mobile mai likh ke run kiya hai.. Thank you bhaiya aap bohot achhha padhate hai. Aur isse pehle maine koi program nahi likha tha apni life mai khud se but aaj maine pehla program likha other than hello world aur mughe bohot khushi bohot khushi bohot khusii ho rahi hai, thank you bhaiya
print("****Addition of Two Numbers****")
a =int(input("Enter the number 1:"))
b =int(input("Enter the number 2:"))
add = a+b
print("Addition of numbers are" ,add)
print("****Substraction of Two Numbers****")
c =int(input("Enter the number 1:"))
d= int(input("Enter the number 2:"))
sub = c-d
print("Substraction of numbers are" ,sub)
print("****Multiplication of Two Numbers****")
e =int(input("Enter the number 1:"))
f =int(input("Enter the number 2:"))
mul =e-f
print("Multiplication of numbers are" ,mul)
print("*****Division of Two Numbers****")
g =int(input("Enter the number 1:"))
h =int(input("Enter the number 2:"))
div =g/h
print("Division of Numbers are" ,div)
well, I did it quite different. I did it as
a = 15
b = 12
c = a + b
d = a - b
e = a * b
f = a / b
g = a % b
h = a ** b
i = a // b
print("The addition of", a,"+",b,"is", c)
Bro how is this a calcator??
Cause you are assigning the values by your own!
@@GoluRajput-h1u but he didnt teached input yet, he meant it as idle based not in console based so this is the right one, those were either gpt scripted or by the people who've learned python before too
a=int(input("Enter the value of a = "))
b=int(input("Enter the value of a = "))
print("a+b =", a+b)
print("a-b =", a-b)
print("a*b =", a*b)
print("a/b =", a/b)
print("a Percentile b", a%b)
❤❤
😂😂😂
pleas me help
The best teacher on RUclips ❤️
no he is gretest techer
a = int(input("enter first number"))
b = int(input("enter secod number"))
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print ("thank you for this 100 days course of python")
a=float(input("Entre first number = "))
b=float(input("Entre second number = "))
print("The sum is=",a+b )
print("The Subtraction is=",a-b)
print("The multiplication is=",a*b)
print("The division is=",a/b)
print("The mode is =", a%b)
a = int(input("enter the first number:"))
b= int(input("enter the second number:"))
c= input("enter the operation to be performed:")
if c== "addition":
print (a+b)
elif c == "subtraction":
print(a-b)
elif c == "multiplication":
print(a*b)
elif c=="division":
print(a/b)
else:
print("operation not applicable")
hey can you please help me, how to make calculator as a program?
print("This is a calcuator.")
a = int(input("Enter first num"))
c = str(input("+ - * /"))
b = int(input("Enter second num"))
if c == "+":
print(a+b)
elif c == "-":
print(a-b)
elif c == "/":
print(a/b)
elif c == "*":
print(a*b)
🥶
I also created my calculator the same way
Others in comment are over writing the whole code while it is damn easy!!
@@ayaankhatib3509 bro i am very confused , how can i solve this exercise or make a calculator?
thank u bro
After scrolling so many comments I have found a well solution ❤
a=int(input("Type the first number"))
b=int(input("Type the second number"))
print("the sum of the two numbers is : " , a+b)
print("the difference of two numbers is : " , a-b)
print("the product of two numbers is " , a*b)
print("the quotient of two numbers is " , a/b)
I'm Present Sir .
05th December 2022
Monday
04:40 pm PST
Respect and love for you Harry bhai from Pakistan .
You're a great and sincere teacher .
May Allah Pak bless you Sir Haris Ali Khan Sahab
@Good Boi same here
@goodboi5405 me from India
i am also from Pakistan
@goodboi5405 I am in pak
@goodboi5405 main b 🥰
A = VALUE
B = VALUE
print ("addition of two value is ", A+B)
print ("SUBTRACTION of two value is" , A-B)
print ("MULTIPLICATION of two value is" ,A*B)
print ("DIVISION of two value is" , A/B)
print ("EXPONENT of two value is" , A**B)
Here are some Repl based shortcuts
Run repl. ctrl + enter.
Open shell. ctrl + shift + s.
open preferences. ctrl + ,
Open version control sidebar. ctrl + shift + g.
open debugger. ctrl + shift + d.
toggle command bar. ctrl + .
Open multiplayer mode. ctrl + shift + m.
Open packages sidebar. ctrl + shift + L.
a=10
b=6
print("Welcome To The Calculator")
# To add the numbers
print("The sum of the given number is: ",a+b)
# To subtract the numbers
print("The difference of the given number is: ",a-b)
# To multiply the numbers
print("The product of the given number is: ",a*b)
# To divide the numbers
print("The divison of the given number is: ",a/b)
# To find remainder the numbers
print("The remainder of the given number is: ",a%b)
print("Thanks For Using..")
]
Harry Bhaiya thank you for all ur free courses and I am getting very much help learning new skills from you and again thank you bhaiya for making us uprade in coding skills 😇
Thnx bro
OK vrz I
x=input ("Enter first number")
y=input ("Enter second number")
print (int(x) + int(y))
print (int(x) - int(y))
print (int(x) * int(y))
print (int(x) / int(y))
Exercise Done 👍
Jitna Sikhaya Hai Utna Use Karke
Because I had just Started Programming
bro ya jo replet k sath day 1 ,day 2 tasks a rhy hn ya mary show ni ho rhy kindly bta dyn is ka
Following are the Time stamp at which i learnt something new
3:16
4:03
Well for those who are just starting
def add (x,y):
return x+y
def subtract (x,y):
return x-y
and so on it is much easier to do it like this and it runs faster
print("welcome to the calculator
select number according to the operation
")
print("1:-Sum
2:-Substact
3:-multiply
4:-divide")
userpass = int(input())
print(userpass)
if (userpass < 5) :
print("enter your first number")
a=int(input())
print("enter your second number")
b=int(input())
match userpass:
case 1:
print(a + b);
case 2:
print(a - b);
case 3:
print(a * b);
case 4:
print(a / b);
case other:
print("select valid number")
else:
print("select out 4 number pleases")
3:30 Bhai ek hi dil hai kitti baar jeetoge , Love You harry Bhai ❤ Greatest teachers of all time ❤
a = int(input("enter first number:"))
b = int(input("enter second number:"))
print("addition:" , a+b )
print("subtract" , a-b)
print("multiply" , a*b)
print("divide" , a/b)
Going to be honest here,
I brainstormed till headache as to how can i make a code in which i give an option to input a number to the user, but with the 7 videos of knowledge how could i have done that 😅
So thank you harry bhaiya for your morale support in each and every video,❤
i too thought we were supposed to make an actual Calculator
Exactly
same bro brainstormed so much and felt sad for not knowing how to do that floating thing, its completely fine right if we just use the numbers he gave in previous one and create a normal "so called" calculator right ?, we'll be knowing all this in upcoming videos right ??
@@Stoiczons
bro please tell me about the calculator i cant understand
a = int(input("Entre first no : "))
b = int(input("Entre second no : "))
print("operations on two operands are ")
print("addition",a+b)
print("subtraction",a-b)
print("multiplication",a*b)
print("divison",a/b)
print("floor division ",a//b)
print("reminder",a%b)
I felt a bit nervous as I hadn't complete the 1st task given by you but I will continuing with your educational videos. I'm working with an NGO and in free time watched your videos to learn something new. Thanks a lot bro.
Which ngo ??
Isis 🤣🤣
@@Dharmaik_Sanatani bruhhh what did he do to you?
@@Dharmaik_Sanatani does your god teach you to abuse other people based on their relegion??
@@Dharmaik_Sanatani close 2nd RSS
@@munnumkhalid bro , wait for it
I am making the 3rd R.S.S AND 12TH B.J.P. 🤣🤣
any problem...
Can you just focus on learning 🤔 ....
a = 56
b = 45
print("The number of sum", a+b)
print("The number of subtraction", a - b)
print("The number of multiplication", a * b)
print("The number of division", a / b)
print("The number of floor division", a // b)
print("The number of exponential", a ** b)
the best teacher on youtube. I just made calculator in less than 10 mins
bro moja samaj to sara arha ha lakin calculator nai ma rha ha samjao plz
@@HIGHHLIGHTSTV kaise smjayun ?
a = 50
b = 3
print(a + b)
print(a - b)
print(a * b)
print(a / b)
easy and correct
Best teacher ever ... Thank you Herry Bhai
a=4
b=6
print("Addition of 'a' and 'b' is:
",a+b)
print("Subtraction of 'a' and 'b' is:
",a-b)
print("Multiplication of 'a' and 'b' is:
",a*b)
print("Division of 'a' and 'b' is:
",a/b)
print("Modulus(Remainder) of 'a' and 'b' is:
",a%b)
print("Exponentiation of 'a' and 'b' is:
",a**b)
print("Free division of 'a' and 'b' is:
",a//b)
A simple calculator
I did it without using input
a=value
b=value
print ("Addition of two values is",a+b)
print("Subtraction of two values is",a-b)
print("Product of two values is",a*b )
print("Quotient of two values is",a/b)
print("Remainder of two values is",a%b)
print("Exponent of two values is",a**b)
value1=2
value2=3
a=value1
b=value2
print ("Addition of two values is",a+b)
print("Subtraction of two values is",a-b)
print("Product of two values is",a*b )
print("Quotient of two values is",a/b)
print("Remainder of two values is",a%b)
print("Exponent of two values is",a**b)
# now it will work.....
@@AyushDwivedi-jj5zh you're Just a Lil bit late
@@Zen_Phantom 😂😂
a = 3
b = 5
c = a + b
d = a - b
e = a / b
f = a * b
print(c)
print(ad)
print(e)
print(f)a = 3
b = 5
c = a + b
d = a - b
e = a / b
f = a * b
print(c)
print(ad)
print(e)
print(f)
But thnxs alot for this series because of this i am now consistent on my coding even without having a pc. I go to library bcoz they have computers for everyone use or use my smart tv connected with wireless keyboard and mouse for using replit and do coding.
Hope to finish 100 days and be with you always.
replit is available in mobile .
c=45
d=2
print("the value of",c,"+",2,"is:", c+d)
print("the value of",c,"+",2,"is:", c*d)
print("the value of",c,"+",2,"is:", c%d)
print("following are all opration of calculator:")
a=input("enter a first number =")
b=input("enter a second number=")
c=float(a)+float(b);
print("the sum of {0} and {1} is {2}".format(a,b,c))
d=float(a)-float(b)
print("the sub of {0} and {1} is {2}".format(a,b,d))
e=float(a)*float(b)
print("the sub of {0} and {1} is {2}".format(a,b,e))
f=float(a)/float(b)
print("the sub of {0} and {1} is {2}".format(a,b,f))
g=float(a)%float(b)
print("the sub of {0} and {1} is {2}".format(a,b,g))
format is stupid, use f strings
Code Backup Repository: github.com/CodeWithHarry/100-days-of-code-youtube
Bhai 1 Request hai appse ki thoda sa Add Kam kar do
hello harry bhai is code me koi bhi error nhi arha ha per 3rd input se age nhi ja rha ha .
print("hello this is a pahadi calculater")
A = float(input("pela number pa:"))
B = float(input("apna dursa number pa:"))
i = float(input("1 type kera ager jodna ha
2 type kera agerghatana ha
3 type kera ager gudna kerna ha
4 ager vibhajit kerna ha
apna operater select kera:"))
if i== 1:
print = ("apka utter ha : ", A + B)
elif i== 2:
print = ("apka utter ha : ", A - B)
elif i== 3:
print = ("apka utter ha : ", A * B)
elif i== 4:
print = ("apka utter ha : ",A / B)
else :
print = ("error detected")
Present
print("""It's is a calculater for all basic mathamatics tools
like :- Addition , substraction , Division , multiplication and Greatest Integer of division of any Number""")
A = int(input("Enter your first Digit = "))
B = int(input("Enter Your second Digit = "))
print("Addition is = " , (A+B) )
print("Substraction is", (A-B))
print("multiplication is " , (A*B))
print("division is " , (A/B))
print("Greatest Integer is", (A//B))
Thanks, Harry. I am not able to create the calculator but learning from you. will update on the 100th day
# I have Made this as a new
try:
print("1.Table
2.Multiplication
3.Subtraction
4.Divide
5.Addition
6.Square
7.Cube")
q = input("What do you want?. Type a value of it: ")
if q == '1':
tablenum = int(input("which table you want?: "))
table1 = int(input("x x y = x: type your y: "))
print("
")
for table1 in range(table1 + 1):
print(f"{tablenum} x {table1} = ", table1 * tablenum)
elif q == '2':
j = input("decimal or round - d or r: ")
if j == 'r':
g = int(input("Write your 1st number: "))
h = int(input("Write your 2nd number: "))
elif j == 'd':
g = float(input("Write your 1st number: "))
h = float(input("Write your 2nd number: "))
print((f"{g} x {h} = ",g*h))
else:
print("sorry!!")
elif q == '3':
sub1 = int(input("Type your first number: "))
sub2 = int(input("Type your second number: "))
print(f"{sub1} - {sub2} =", sub1-sub2)
elif q == '4':
div1 = int(input("Type your first number: "))
div2 = int(input("Type your second number: "))
divq1 = input("Do you want it in round - y or n: ")
if divq1 == 'y':
round_a = round(div1/div2)
print(f"{div1} / {div2} =", round_a)
elif divq1 == 'n':
print(f"{div1} / {div2} =", div1/div2)
else:
print("sorry!!")
elif q == '5':
add1 = int(input("Type your first number: "))
add2 = int(input("Type your second number: "))
print(f"{add1} + {add2} =", add1+add2)
elif q == '6':
sq = int(input("Type number you want to have his square: "))
print(f"Square of {sq} is:", sq*sq)
elif q == '7':
cb = int(input("Type number you want to have his cube: "))
print(f"Square of {cb} is:", cb*cb*cb)
else:
print("Sorry!!")
except:
print("Sorry!!")
same with me
a=int(input("Enter First number:"))
b=int(input("Enter Second number:"))
add=a+b
sub=a-b
mul=a*b
div=a/b
print("Addition of First and Second number is",add)
print("subtraction from First number to Second number is", sub)
print("product of first and second number is", mul)
print("Division of First number by second number is", div)
One of the best teacher on RUclips ❤
import math
def add(a, b):
return a + b
def subtract(a, b):
return a - b
def multiply(a, b):
return a * b
def divide(a, b):
if b == 0:
raise ValueError("Division by zero is not allowed.")
return a / b
def power(a, b):
return a ** b
def root(a, b):
if b == 0:
raise ValueError("Root with exponent 0 is not defined.")
return a ** (1 / b)
def square(a):
return a ** 2
def cube(a):
return a ** 3
def sqrt(a):
if a < 0:
raise ValueError("Square root of a negative number is not defined.")
return math.sqrt(a)
def cbrt(a):
return math.pow(a, 1 / 3)
def log(a, b):
if b
L1 = ["addition", "subtraction", "multiplication", "division", "modular division", "integer division", "exponentiation"]
a = int(input("Enter first number
"))
b = int(input("Enter second number
"))
print("The options are ",L1)
c = input("What operation do you want to do
")
while c not in L1:
print("The operation is not in List")
c = input("So, Enter the name of operation.
")
c = c.lower()
def add(x, y):
z = x + y
return z
def subtract(x, y):
z = x - y
return z
def divide(x, y):
z = x / y
return z
def multiply(x, y):
z = x * y
return z
def modular(x, y):
z = x % y
return z
def integer(x, y):
z = x // y
return z
def exponentiation(x, y):
z = x ** y
return z
if c == "addition" :
result = add(a, b)
elif c == "subtraction" :
result = subtract(a, b)
elif c == "multiplication" :
result = multiply(a, b)
elif c == "division" :
result = divide(a, b)
elif c == "modular division":
result = modular(a, b)
elif c == "integer division":
result = integer(a, b)
elif c == "exponentiation":
result = exponentiation(a, b)
print (result)
result is not defined...
firstNumber = int(input("input your first number: "))
operatorN = input("input your operator: ")
secondumber = int(input("input your second number: "))
if (operatorN == "+"):
print(firstNumber + secondumber)
elif(operatorN == "-"):
print(firstNumber - secondumber)
elif(operatorN == "*"):
print(firstNumber * secondumber)
elif(operatorN == "/"):
print(firstNumber / secondumber)
Thanks alot Harry sir. So many people in Pakistan praise the way you teach so nicely. and your way of explanation is great. It's great that you are teaching things from scratch, I was totally new in python
what is its use if your mindset is 1500 old and gross
create a new language"pakthon"
@@saransh9373 this represents ke jahil log bhare he india me, jinko seedhi bat me bhonkna soojta he. jahil country ke jahil log
@@elon7385 oh kuttay, your religion is more old then 1500, wese bhi parhne toh muslim se aai ho, harry is muslim, india me agay muslims hein, chahy woh bollywood ho ya yeh youtube
@@saransh9373 pata nhi kaha se aa jate he ghatia log jinko simple bat me bhi larai karni hoti he, maa ne tarbiyat itni ghatia ki he.
n=int(input())
m=int(input())
print("add of the two number: ", n+m)
print("subtract of the two number: ",n-m)
print("multiplication of the two number: ",n*m)
print("division of the two number :",n/m)
print("modulus of the two number: ",n%m)
print("folor division of two number :",n//m)
Attendence Day 8 #100dayscodingchallenge #python #codeWithHarry❤Enjoying the course Thanks for teaching us from the heart with humbleness ,values & great efforts bhai❤ time : - 23:59
print("1 - add")
print("2 - multiply")
print("3 - subtract")
print("4 - divide")
option = int(input("choose an opertion"))
if(option in[1,2,3,4]):
num1 = int(input("enter first number"))
num2 = int(input("enter second number"))
if(option == 1):
result =num1 + num2
elif(option == 2):
result = num1 * num2
elif(option == 3):
result = num1 - num2
elif(option == 4):
result = num1 // num2
else:
print("invalid opertion entered")
print("the result of the opertion is{}".format(result))
You didn't tell us how to create calculator
yes 😂 jo study kr rha hai is field me usko to samaj ayega kese creat krna hai but me to pharmacy kiya hua banda hoon kuch palle nai pada kese creat krna hai woh😂
@@chillo_829 me to arts ka banda hu vo bhi 11th ka how to make it very confused
Yeah bro I'm science student in 11th this is my first programming language
I understand everything but I didn't know how to apply it and where do I can apply it.🥲
@@AfreenAnsari-9876 It has scope in engineering domain. Both C and python languages are required to excel in that domain.
a=45
b=35
ans1= a+b
print('addition of two numbers is '+ str(ans1))
ans2=a-b
print('subtraction of two numbers is '+ str(ans2))
ans3=a*b
print('multiplication of two numbers is '+ str(ans3))
ans4=a/b
print('division of two numbers is '+ str(ans4))
Bhai thoda basic to bata hi dete ek program ke example se😢
mujhe pata hai ke mein 1 saal late hun lekin mujhe begginer programs banane aate hain lekin ye wala jo bande start se python skh rahen un ke liye bohot mushkil hai
Num1=int(input("enter the number:"))
Num2=int(input("enter the number:"))
add=Num1+Num2
mul=Num1*Num2
div=Num1/Num2
sub=Num1-Num2
floor=Num1//Num2
exponention=Num1**Num2
print("Addition of number is",add)
print("Subtraction of number is",sub)
print("Multiplication of number is",mul)
print("Division of number is",div)
print("Floor division of number is",floor)
print("Exponention of number is ",exponention)
Thanks Alot Guys For Your Love And Support Guys Love You All 🥺💛😘✨
class FirstClass{
public static void main(String[] args){
System.out.println("What Is Your Name");
Scanner sc = new Scanner(System.in);
String name sc.next();
System.out.println("Hell" + name + "great job");
}
}
भाई मेरा ये कोड run नहीं कर रहा please help करो
क्या problem हैं इसमें
@@armylover-mo6cf String name = sc.next()
num1=int(input("please enter the frist nunber="))
num2=int(input("please enter the scond number="))
result=num1+num2
print("The sumition is=",result)
result=num1-num2
print("The abtruction is=",result)
result=num1*num2
print("The multiplecation is=",result)
result=num1/num2
print("The divitiion is=",result)
result=num1%num2
print("The modulas is=",result)
result=num1//num2
print("The floor is=",result)
print("This is a calcuator.")
a=int(input("Enter the first number"))
b=int(input("Enter the second number"))
c=str(input("Enter the operater,(+ - * /):"))
if c=="+":
print("the sum of the numbes is",a+b)
elif c=="-":
print("the difference between the numbers is ",a-b)
elif c=="/":
print("the quotient of the numbers is ,",a/b)
elif c=="*":
print("the product of the numbers is",a*b)
else:
print("invalid input")
Fun Fact: Half of the students had already learnt python from your olden videos. Even I Too!!
# I have Made this as a new
try:
print("1.Table
2.Multiplication
3.Subtraction
4.Divide
5.Addition
6.Square
7.Cube")
q = input("What do you want?. Type a value of it: ")
if q == '1':
tablenum = int(input("which table you want?: "))
table1 = int(input("x x y = x: type your y: "))
print("
")
for table1 in range(table1 + 1):
print(f"{tablenum} x {table1} = ", table1 * tablenum)
elif q == '2':
j = input("decimal or round - d or r: ")
if j == 'r':
g = int(input("Write your 1st number: "))
h = int(input("Write your 2nd number: "))
elif j == 'd':
g = float(input("Write your 1st number: "))
h = float(input("Write your 2nd number: "))
print((f"{g} x {h} = ",g*h))
else:
print("sorry!!")
elif q == '3':
sub1 = int(input("Type your first number: "))
sub2 = int(input("Type your second number: "))
print(f"{sub1} - {sub2} =", sub1-sub2)
elif q == '4':
div1 = int(input("Type your first number: "))
div2 = int(input("Type your second number: "))
divq1 = input("Do you want it in round - y or n: ")
if divq1 == 'y':
round_a = round(div1/div2)
print(f"{div1} / {div2} =", round_a)
elif divq1 == 'n':
print(f"{div1} / {div2} =", div1/div2)
else:
print("sorry!!")
elif q == '5':
add1 = int(input("Type your first number: "))
add2 = int(input("Type your second number: "))
print(f"{add1} + {add2} =", add1+add2)
elif q == '6':
sq = int(input("Type number you want to have his square: "))
print(f"Square of {sq} is:", sq*sq)
elif q == '7':
cb = int(input("Type number you want to have his cube: "))
print(f"Square of {cb} is:", cb*cb*cb)
else:
print("Sorry!!")
except:
print("Sorry!!")
@samdarsh674 job ni lgi na teri
num1 = int(input('enter the ist num:'))
num2 = int(input('enter the sec num:'))
sign = input('enter the operation:')
if (sign == "+"):
print(num1+num2)
elif (sign == "-"):
print(num1-num2)
elif (sign == "*"):
print(num1*num2)
else:
print(num1/num2)
while True krdo for repetition
2024 attendance ---------->
a = int(input("Enter Number"))
b = int(input("Enter Number"))
c = int(a+b)
d = int(a-b)
e = int(a*b)
f = int(a/b)
g = int(a // b)
h = int(a%b)
i = int(a**b)
print(c)
print(d)
print(e)
print(f)
print(g)
print(h)
print(i)
Bhaiya day 9 ki video kbb ayegi
Abhi tk nhi ayi
😭😭
num1=2
num2=3
print("sum is +", num1+num2)
print("sum is -",num1-num2)
print("sum is ×",num1*num2)
print("sum is ÷ ",num1/num2)
#my calculator thank you sir for teaching
x = input("enter equation here =")
Result = eval(x)
try:
print("result =",Result)
print("Thanks for using our calculator")
except ValueError:
print("Enter a valid chracter")
num1 = float(input("Enter the 1st value: "))
num2 = float(input("Enter the 2nd value: "))
print("""choice operation which you want
additon: 1
substraction: 2
division: 3
multiplilcation: 4
""")
operation = int(input("enter which type of operation you wnat: "))
if operation == 1:
print("sum of two numbers: " , num1 + num2)
if operation == 2:
print("differnce of two numbers: " , num1 - num2)
if operation == 3:
print("division of two numbers: " , num1 / num2)
if operation == 4:
print("multiplication of two numbers: " , num1 * num2)
#asking for nummbers
a=input("type your first number
")
b=input("type your seacond number
")
#asking what user wanna do
c=input("What you want to do your options are:
+
-
*
/
chose the one option
")
#Checking what the user chose
if c=="+":
print(int(a)+int(b))
elif c=="-":
print(int(a)-int(b))
elif c=="*":
print(int(a)*int(b))
elif c=="/":
print(int(a)/int(b))
print ("Calculator")
a = int(input("Enter the first number: "))
b = int(input("Enter the second number: "))
print("To add type 1")
print("To subtract type 2")
print("To multiply type 3")
print("To divide type 4")
c = int(input("Enter the number: "))
if c ==1:
print("The sum of the numbers is",a+b)
elif c==2:
print("The subtraction of the numbers is",a-b)
elif c==3:
print("The multiplication of the numbers is",a*b)
if b==0 and c == 4:
print ("not defined")
elif c==4:
print("The division of the numbers is",a/b)
else:
print("Please check your input value")
def Calculator(choice,a,b):
if choice==1:
print("the sum is :")
return a+b
if choice==2:
print("the difference is :")
return a-b
if choice==3:
print("the multiplication is :")
return a*b
if choice==4:
print("the division is :")
return a/b
if choice==5:
print("the modulo is :")
return a%b
else:
return "wrong choice"
choice=int(input("Enter the user's choice : "))
a=int(input("enter the 1st number :"))
b=int(input("enter the 2nd number :"))
res=Calculator(choice,a,b)
print(res)
#calculator
a=int(input("enter a number"))
b=int(input("enter another number"))
C=input("enter your choice")
If C=="+":
Print(a+b)
Elif C=="-":
Print(a-b)
Elif C=="×":
Print(a×b)
Elif C=="/":
Print(a/b)
Else:
Print("entered choice not available ")
a = input("enter your number: ")
c = input("Enter Operatot: ")
b = input("enter your number: ")
D=int(a) + int(b)
E=int(a) / int(b)
F=int(a) - int(b)
G=int(a) * int(b)
if c == "+":
print(D)
elif c == "-":
print(F)
elif c == "/":
print(E)
elif c == "*":
print(G)
else:
print("invalid")
a=int(input("enter the 1st number:"))
b=int(input("enter the 2nd number:"))
print("the value of",a,"+",b,"is :",a+b)
print("the value of",a,"-",b,"is :",a-b)
print("the value of",a,"*",b,"is :",a*b)
print("the value of",a,"/",b,"is :",a/b)
a = 10
b = 5
ans1 = a+b
print("Addition of",a,"and",b,"is",ans1)
ans1 = a-b
print("subtraction of",a,"and",b,"is",ans1)
ans1 = a*b
print("multiplication of",a,"and",b,"is",ans1)
ans1 = a/b
print("division of",a,"and",b,"is",ans1)
ans1 = a%b
print("mudulus of",a,"and",b,"is",ans1)
ans1 = a//b
print("floor division of",a,"and",b,"is",ans1)
#variables
a = 5
b = 10
c = 15
d = 20
e = 25
# operations
add = a+b
sub = c-b
mul = c*d
div = e/a
exp = a**b
floordiv = e//d
modulus = e%a
#output
print("Addition of a and b : ", add)
print("Subtraction of b and c: ", sub)
print("Multiplication of c and d: ", mul)
print("Division : of e and a", div)
print("Exponentiation of a and b: ", exp)
print("Floor Division : of e and d :", floordiv)
print("Modulus : of e and a :", modulus)
first = int(input("Enter the first number: "))
second = int(input('Enter youre second number: '))
operator = input('Enter youre operator: ')
operator = operator.lower()
if operator == '+':
print(first + second)
elif operator == '-':
print(first - second)
elif operator == '*':
print(first * second)
elif operator == '/':
print(first / second)
else:
print('invalid input')
a = int(input("enter your number here:\t"))
b = int(input("enter you second number here:\t"))
print("add the above numbers\t----------->", a+b)
print(f"subtract the above number\t---> {a-b}")
print(f"divide the above number\t----------> {a/b}")
print(f"multiply th above numbers\t---> {a*b}")
print("welcome to calculator")
a = float(input("what is the first no. ?"))
b = float(input("what is the second no. ?"))
answer1 = a+b
print("the addition is ", answer1)
answer2 = a-b
print("the subtraction is ", answer2)
answer3 = a*b
print("the multiplication is ", answer3)
answer4 = a/b
print("the division is ", answer4)
answer5 = a**b
print("the power is ", answer5)
answer6 = a//b
print("the floor division is ", answer6)
answer7 = a%b
print("the module is ", answer7)
The addition of 12 and 14 is 26
The subtraction of 12 and 14 is -2
The multiplication of 12 and 14 is 168
The divison of 12 and 14 is 0.8571428571428571
The absolute of 12 and 14 is 12
a=455
b=4545
c=a+b
d=a*b
e=a/b
f=a-b
print (c)
n=15
m=7
ans1= n+m
print ("addition of",n, "and" , m, "is" , ans1 )
ans2=n-m
print ("subtraction of",n, "and" , m, "is" , ans2 )
ans3= n*m
print ("multiplication of",n, "and" , m, "is" , ans3 )
ans4= n/m
print ("division of",n, "and" , m, "is" , ans4 )
ans5= n%m
print("modulus of",n,"and",m, "is" ,ans5 )
ans6=n//m
print ("floor division of",n, "and" , m, "is" , ans6 )
print("select an opration to perform: ")
print("1. ADD")
print("2. SUBTRACT")
print("3. MULTIPLY")
print("4. DIVIDE")
operation = input()
if operation == "1":
num1 = input("Enter first number")
num2 = input("Enter second number")
print("The sum is " + str(int(num1) + int(num2)))
elif operation == "2":
num1 = input("Enter first number")
num2 = input("Enter second number")
print("The differece is " + str(int(num1) - int(num2)))
elif operation == "3":
num1 = input("Enter first number")
num2 = input("Enter second number")
print("The multiplication is is " + str(int(num1) * int(num2)))
elif operation == "4":
num1 = input("Enter first number")
num2 = input("Enter second number")
print("The product is " + str(int(num1) / int(num2)))
else:
print("Invalid entry")
a = 10
b = 8
add = a + b
sub = a - b
multiply = a * b
divide = a / b
floordivide = a // b
exponential = a ** b
modulus= a % b
print("addition of",a,"and",b,":",add)
print("subtraction of",a,"and",b,":",sub)
print("multiplication of",a,"and",b,":",multiply)
print("division of",a,"and",b,":",divide)
print("floor division of",a,"and",b,":",floordivide)
print("exponential of",a,"and",b,":",exponential)
print("modulus of",a,"and",b,":",modulus)
print(int(eval(input("Enter values and operations:"))))
3:25 to replicate line alt + shift + down arrow
a=23
b=45
print(a+b)
print(a*b)
print(a/b)
print(a-b)
a = 16
b = 4
print(a+b)
print(a-b)
print(a*b)
print(a/b) short cut sea make a calculator
a=int(input("Enter the first number:"))
b=int(input("Enter the second number:"))
ans1=int(a)+int(b)
print("The addition of",a, "and", b,"is:",ans1)
ans2=int(a)-int(b)
print("The subtraction of",a, "and", b,"is:",ans2)
ans3=int(a)*int(b)
print("The multiplication of",a," and", b,"is:",ans3)
ans4=int(a)/int(b)
print("The division of",a, "and", b,"is",ans4)
Its day 8th but for me its day 2 nd but I got my solution after seeing everyones but not copied
You can have a look :-
print("welcome to the calculator ")
x=int(input("enter the first number:"))
y=int(input("enter the second number "))
a=x+y
b=x-y
c=x*y
d=x/y
print("For subtraction, multiplication and division press enter ")
input(a)
input(b)
input(c)
input(d)
print ("the sum of the two numbers is",a)
print ("the difference between two numbers is",b)
print("the product of the two numbers is ",c)
print("the quotient of the two numbers is",d)
I know its kinda small and not like calculator but by watching only few videos I think its pretty nice ❤😅
# make a very simple calculator
a=3
b=6
print("The addition is:",a+b)
print("The subtraction is:",a-b)
print("The multiplication is:",a*b)
print("The division is:",a/b)
print("The remainder is:",a%b)
print("The cube of 6 is:",6**3)
while True:
a = input("the first number")
c = input (" what you have to do")
b = input("the second number")
if c == '+':
print ('the final result is',int(a) + int(b))
elif c == '-':
print ('the final result is',int(a) - int(b))
elif c == '*':
print ('the final result is',int(a)* int(b))
elif c == '/':
print ('the final result is',int(a) / int(b))
else:
print('the input is invalid')
break
def divid(z,e):
return z//e
def subtract(x, y):
return x - y
print("please one option chose karen:")
print("1. divid")
print("2. Subtract")
choice = input("Apna choice enter karen (1/2): ")
num1 = float(input("Pahla number enter karen: "))
num2 = float(input("Dusra number enter karen: "))
if choice == '1':
print(num1, "//", num2, "=", divid(num1, num2))
elif choice == '2':
print(num1, "-", num2, "=", subtract(num1, num2))
else:
print("Galat input")
#asking for nummbers
a=input("type your first number
")
b=input("type your seacond number
")
#asking what user wanna do
c=input("What you want to do your options are:
+
-
*
/
chose the one option
")
#Checking what the user chose
if c=="+":
print(int(a)+int(b))
elif c=="-":
print(int(a)-int(b))
elif c=="*":
print(int(a)*int(b))
elif c=="/":
print(int(a)/int(b))
thanks kunal for idea 5:59
a=1
B=1
Print(a+b)
Print(a-b)
Print(a*b)
Print(a/b)
Can we made like that?
Day 1,2,3,4,5= 29thaug,30thaug,31staug
Day6,7,8= 1st Sep
or like this
x=int(input("Enter the value of a = "))
y=int(input("Enter the value of a = "))
print("x+y =", x+y)
print("x-y =", x-y)
print("x*y =", x*y)
print("x/y =", x/y)
print("WELCOME TO THE CALCULATOR")
a=int(input("Enter 1st number:"))
b=int(input("Enter 2nd number:"))
print("the ans is",a+b,"When addition")
print("the ans is",a-b,"When Sub")
print("the ans is",a*b,"When Multiplication")
print("the ans is",a/b,"When Divions")
This is the simple calculator which performs addition , subtraction, division and multiplication for two numbers , without performing and showing all the operations in one go by using if else condition.
you have to just input first number, second number and the operation vwhich you want to use, and then you'll get the result
num1= float(input("Enter first number:"))
num2= float(input("Enter second number:"))
operator= input("Enter operator(+,-,/,*)")
if operator == '+':
result = num1+num2
print("result:",result)
if operator == '-':
result = num1-num2
print("result:",result)
if operator == '*':
result = num1*num2
print("result:",result)
if operator == '/':
result = num1/num2
print("result:",result)
else:
print("Invalid operation")
hope you'll find it useful
a=int(input("first number:"))
b=int(input("second number:"))
print("sum of",a ,"+",b,"=",a+b)
print("Subtract of",a ,"-",b,"=",a-b)
print("Product of",a ,"*",b,"=",a*b)
print("Division of ",a ,"/",b,"=",a/b)
print("Remainder of ",a ,"%",b,"=",a%b)