number1 = int(input("Enter a number:")) symbol = str(input("Enter a symbol:")) number2 = int(input("Enter another number:")) if symbol == '+': print(number1 + number2) if symbol == '-': print(number1 - number2) if symbol == '*': print(number1 * number2) if symbol == '/': print(number1 / number2) if symbol == '**': print(number1**number2) if symbol == '%': print(number1 % number2) if symbol == '//': print(number1 // number2)
a=int(input("Type the First Number")) b=int(input("Type the Second Number")) print("The Sum of 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 Division of Two Numbers is : " , a/b) print("Love you Harry Bhai for Your Efforts")
thanks bhai mujhe samajh nahi aa rah tha kaisa banaun input wala portion nahi pata thi mujhe maine tumhare code ko dekh kar banaya hai plus maine usme floor divisions or exponentials add karein hain CODE: a=int(input("Enter the digits(A) here:")) b=int(input("Enter the other digits (B) here:")) print("The sum of digits is:",a+b) print("The subtraction of digits is:",a-b) print("The multiplication of digits is:",a*b) print("The division of digits is:",a/b) print("The power of digit a by digit b is:",a**b) print("The floor divison of digits is:",a//b)
harry bhai apko andaza nahi hoga ki aap kitne logo ki zindagi ko impact kar rahe ho dhanyawad is playlist ke liye program run ho gya mera and am a beginner
Brother, In today’s fast-paced world, no one has time to teach such skills to anybody. Mostly companies seek expert who immediately start generating revenue for them, leaving little room for those who are eager to learn but lack the necessary resource to learn. After searching extensively on various platforms like LinkedIn for resources to learn Python then I found your RU-vid Channel. You never know how much happy I am after getting this. You gave a ray of hope to me. Thank you Bhai. God Bless you. I love your way of teaching and guiding. Thank you for becoming helping hands for Many.
print("Present Sir") a = int(input("enter first number ")) b = int(input("enter second number ")) c = int(input( "Enter 1 for addition Enter 2 for subtration Enter 3 for multiplication Enter 4 for division Enter 5 for exponential Enter 6 for Floor division ")) if c == 1: print(a + b) elif c == 2: print(a - b) elif c == 3: print(a * b) elif c == 4: print(a / b) elif c == 5: print(a - b) elif c == 6: print(a // b) else: print("wrong choice")
Harry Bhai Please offer the certification for this course , & make The Certification criteria very Tough Which makes it challenging and more fun 🔥🔥 , Enjoying The Course Harry Bhai Thanks ❤️
#Suggestion:- Giving a Certificate for this course will be a great Idea, This is the first time we can have the opportunity not just #100dayscodingchallenge But also to get the certificate from our favourite Code with Harry Bhai ... You can make the certification criteria tough means we need to master our python skills so sharp and we need to make amazing projects or a tough test which shows that we really work hard and did justice with this #100daysofcode challenge.. I really think many of us will like this and whoever will get this certificate, this certificate is one of the most precious certificate we ever get in our life till now bcoz :- 1) We get this from our code with harry bhai 2) To get this certificate we need to work hard for 100days which will really help us in getting job ready or able to do freelancing .... P.S: - Yesterday I wrote this comment and 91+ people liked this idea .... But I try to edit my comment due to which comment is automatically deleted 🥲 , So , I am writing again ... P.S :- This thing I want to add .... Even you can provide a paid certification at 500 - 1000 rs. & I think many of us can afford this much, & we are really happy to pay here bcoz the value and quality of content you provide Harry Bhai is way more than this little amount & this way we can some how contribute a little ... Or you can also do free and paid Certification distribution based on performance and hard work of everyone through examination or projects ..... i,e., Best performers get the certification free as a reward & whoever score 75% + score and eligibility criteria able to get there certificate by paying a little amount ... - just a suggestion 😇 Enjoying the course ,& the energy excitement you bring to this course Grateful to have a Teacher and Harry Bhai ❤️ like You with huge respect and Blessings from my bottom of the heart ❤️ ✨🙌 Thank You so Much for reading my suggestion Have a Good Day😊❤️
a=60 b=2 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) Sir please have a look 😇😇
a= int(input()) b= int(input()) print("sum of the two numbers",a + b) print("difference of two numbers", a-b) print("multiplication of two numbers",a*b) print("division of two numbers",a/b) Thanks bhaiya for your efforts❤❤
a = int(input("Enter your first number :- ")) b = int(input("Enter your second number :- ")) c = print('''Your choices are - 1. + 2. - 3. * 4. /''') d = input("Enter the operator which you want to perform with those two numbers :- ") if (d == "+"): print(f"The sum of {a} and {b} is",a+b) elif d == "-": print(f"The subtraction of {a} and {b} is", a-b) elif d == "*": print(f"The product of {a} and {b} is", a*b) elif d == "/": print(f"The division of {a} and {b} is", a/b)
With Input: a = int(input("Enter a: ")) b = int(input("Enter b: ")) print("Addition of the two values is", a + b) print("Subtraction of the two values is", a - b) print("Multiplication of the two values is", a * b) print("Division of the two values is", a / b) print("Modulus of the two values is", a % b) print("Exponent of the two values is", a ** b) print("Floor division of the two values is", a // b) Without Input: a = 5 b = 2 print("Addition of the two values is", a + b) print("Subtraction of the two values is", a - b) print("Multiplication of the two values is", a * b) print("Division of the two values is", a / b) print("Modulus of the two values is", a % b) print("Exponent of the two values is", a ** b) print("Floor division of the two values is", a // b)
A calculation for basic solution is operator=input("(+,-,*,/)") a=float(input("enter the first number")) b=float(input("enter the first number")) if(operator=="+"): print(a+b) elif(operator=="-"): print(a-b) elif(operator=="*"): print(a*b) else: print(a/b)
Waise Bhai abhi Harry ne input using method se kaha nhi hai ki solve kro simple basic se kro dheere dheere understanding khud bnn jyegi @@shrimalidevashish56
a = float(input("Enter first Number")) b = float(input("Enter second Number")) c = input ("Enter operator") print ("Thanks to Harry, for the Great Leacture") if c == "+": print ( a + b) elif c == "-" : print (a-b) elif c == "*" : print (int(a*b)) elif c == "/" : print (int(a/b)) elif c =="%" : print (a%b) elif c == "**" : print (a**b) else: print ("Invalid operator")
A more neat code:- a = int(input("Enter a number: ")) b = int(input("Enter another number: ")) print("Adding", a, "and", b, "gives:", a+b) print("Subtracting", b, "from", a, "gives:", a-b) print("Multiplying", a, "and", b, "gives:", a*b) print("Dividing", a, "by", b, "gives:", a/b) print("Floor Dividing", a, "by", b, "gives:", a//b) print("Remainder after Dividing", a, "by", b, "is:", a%b) print("If", b, "is the exponent of", a, ", it equals to:", a**b)
@@Lucifer_Bloody_Morningstar bro small suggestions from my side aap beech me double code use nahi kar sakte like print("division", a "by" b,a/b) Harry bhai ne pehle bhi bola hai is tarah use karna hai apko print ("division" a \"by\" b, a/b)
@@aslameditz3895 Bro ye code sahi aayega. Double-quotes ke bich mei comma hai. Quotes ke andr ka sab kuch as it is print ho jayega aur jo quotes ke bahar hai vo variable maan liya jayega.. Please try the code. It works finely.
Day 2 of #100DaysOfCode. In This Video of Day7 of this course, I learned about arithmetic operators in Python, which are crucial for calculator operations. These operators include addition, subtraction, multiplication, division, modulus, and floor division. By using variables and arithmetic operators, I created a program that performs basic calculations on two numbers and displays the results in a readable format. Thank You Harry Bhaiya.
a = float(input("Enter first number a =")) b = float(input("Enter second number =")) print("addition=",a+b) print("subtraction",a-b) print(a*b) print(a/b) print(a%b) print(a**b)
good evening harry bhiya congratulation for day 7 of #100days of code in python # Welecome state of the calculator print("welcome to your exercise 1 which is calculator") # Taking the input of two values from user var1 = int(input('enter your first value ')) var2 = int(input('enter your second value ')) # Printing the defined arthemetic operators + - * / # To take out the sum of two numbers print('your sum of two values are :', var1 + var2,'/-') # To take out the stracted value of two numbers print('your subtracted values are:', var1 - var2,'/-') # To take out the multiplied value of two numbers print('your multiplied vlaues are :', var1 * var2,'/-') # To take out the divided value of two number from user print('your divided values are :', var1 / var2,'/-')
print("Choose operation for calculator:") print("1. ADD") print("2. SUBTRACTION") print("3. MULTIPLICATION") print("4. DIVISION") print("5. MODULUS") print("6. FLOOR VALUE") print("7. EXPONENT") operation = input("Enter your choice: ") if operation == "1": num1 = input("Enter first number for Addition: ") num2 = input("Enter second number for Addition: ") print("The Addition of these numbers is:",int(num1)+int(num2)) elif operation == "2": num1 = input("Enter first number for Subtraction: ") num2 = input("Enter second number for Subtraction: ") print("The Subtraction of these numbers is:",int(num1)-int(num2)) elif operation == "3": num1 = input("Enter first number for Multiplication: ") num2 = input("Enter second number for Multiplication: ") print("The Multiplication of these numbers is:",int(num1)*int(num2)) elif operation == "4": num1 = input("Enter first number for Division: ") num2 = input("Enter second number for Division: ") print("The Division of these numbers is:",int(num1)/int(num2)) elif operation == "5": num1 = input("Enter first number for Modulus operation: ") num2 = input("Enter second number for Modulus operation: ") print("The Modulus value of these numbers is:",int(num1)%int(num2)) elif operation == "6": num1 = input("Enter first number for Floor operation: ") num2 = input("Enter second number for Floor operation: ") print("The Floor value of these numbers is:",int(num1)//int(num2)) elif operation == "7": num1 = input("Enter first number for Exponent: ") num2 = input("Enter second number for Exponent: ") print("The Exponent value of these numbers is:",(int(num1)**int(num2))) else: print("You entered an Invalid option!")
we could also use break and continue statements along with if and else to create an infinite loop unless the user wants to terminate it. Also, taking input before having the user to select the type of operation to be performed would help reduce the length of code
Brother i am following you from day 1 (started later ) i have watched your videos twice till day 7 but i cant even make a calculator the way you and other guys showed in video
print(5+6) print(15-6) print(15*6) print(15/6) print(15//6) print(5%3) print(2**4) # Welecome to exercise 1 which is calculator print("Welcome to exercise 1 which is calculator") # Taking the input of two values from user var1 = int(input('Enter your First value ')) var2 = int(input('Enter your Second value ')) # Printing the defined arthemetic operators + - * / # To take out the sum of two numbers print('your sum of two values are :', var1 + var2,'/-') # To take out the stracted value of two numbers print('your subtracted values are:', var1 - var2,'/-') # To take out the multiplied value of two numbers print('your multiplied vlaues are :', var1 * var2,'/-') # To take out the divided value of two number from user print('your divided values are :', var1 / var2,'/-')
a=15 b=5 print("a =",a) print("b =",b) ans1=a+b print("The result of Addition \"a and b\" is ",ans1) ans2=a-b print("The result of subtraction \"a and b\" is ",ans2) ans3=a/b print("The result of division \"a and b\" is ",ans3) ans4=a*b print("The result of multiplication \"a and b\" is ",ans4) ans5=a%b print("The result of modules \"a and b\" is ",ans5)
This code is perfect for students who are beginners. It is related to the concepts we have previously studied thankyou. the solution is: operator = input("ENTER AN OPERATOR(+,-,*,/)") num1 = int(input("ENTER THE FIRST NUMBER: ")) num2 = int(input("ENTER THE SECOND NUMBER: ")) if operator == "+" : print("the addition is ", num1+num2) elif operator == "-" : print("the subtraction is ", num1-num2) elif operator == "*" : print("the multiplication is ", num1*num2) elif operator == "/" : print("the division is ", num1/num2) else: print("Please enter a valied input")
#Excer-1 a=int(input('Enter the value a;')) b=int(input('Enter the value b:')) print("Addition of two number :",a + b) print("Subtraction of two number :",a-b) print("Multiplication of two number:",a*b) print("Division of two number:",a/b) print("Modulus of two number:",a%b) print("Floor Division of two number:",a//b) print("Exponential of two number:",a**b)
I'm Present Sir . 04th December 2022 Sunday 09:34pm 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 = int(input("Enter the first number: ")) b = int(input("Enter another number: ")) operation = input("Choose your calculating operation (^, *, +, -): ") if operation == '^': print(a ** b) elif operation == '*': print(a * b) elif operation == '+': print(a + b) elif operation == '-': print(a - b) else: print("Invalid input")
z=input("Enter Your Choice 1.Addition 2.Subtraction 3.Multiplication 4.Division ") a=input("enter the first number: ") b=input("enter the second number: ") a=int(a) b=int(b) if z=='1': addition= a + b print("Addititon is:",addition) elif z=='2': subtraction= a - b print("Subtraction is:",subtraction) elif z=='3': multiplication= a * b print("Multiplication is:",multiplication) elif z=='4': division= a/b print("Division is:",division) else: print("Enter a valid option")
U can use a=int(input("Enter the first number :- ")), instead of converting it into int after. 1) My code was rejected in code marathon,by this mistake. 2)hope it help you☺️
@@LegXgodGaming common sense hai agar calculator use kroge to hum number se he use karna hoga , itna tension nahi lena python sab common sense ke upar hai. Agar user ko nahi pata toh apke Variable he hi likh do. Eg:- num=int(input (" Enter a number or use only integers :- ")) •hope it help you ☺️
@@FEEL_PAIN07 my code print("CALCULAT0R") con='yes' while con=='yes': a=int(input("Enter Your First Number")) b=int(input("Enter Your Second Number")) add=a+b sub=a-b product=a*b division=a/b power=a**b ans=int(input("CHOOSE WHAT YOU WANT for add inter 1 for sub inter 2 for product inter 3 for division inter 4 for power inter 5")) if ans==1: print(add) elif ans==2: print(sub) elif ans == 5: print(power) elif ans == 4: print(division) elif ans == 3: print(product) else : print("please choose sub add power division product anything else want work") con=input("calculation done do you want more calculation? (yes/no)") print("task end")
a=int(0) b=int(0) choice=1,2,3 print("1 for edition,2 for multiplection , and 3 for divition ") choice = int ( input("plese enter your choice")) a= int(input("plese enter the value of a")) b= int(input("plese enter the value of b")) if choice==1: print(a+b) elif choice==2: print(a*b) elif choice==3: print(a/b)
A = float(input("The first nuumber: ")) B = float(input("The second number: ")) result = (A + B) result1 = (A*B) result2 = (A/B) result3 = (A - B) result4 = (A**B) result5 = (A//B) print(result) print(result1) print(result2) print(result3) print(result4) print(result5)
a=2 b=3 print("The Summation of a and b is ",a+b) print("The Subtraction of a and b is ",a-b) print("The Multiplication of a and b is ",a*b) print("The Division of a and b is ",a/b) print("The Exponential of a and b is ",a**b) print("The Modulus of a and b is ",a%b) print("The Floor Division of a and b is ",a//b)
this the program I created for first time. # This function adds two numbers def add(x, y): return x + y # This function subtracts two numbers def subtract(x, y): return x - y # This function multiplies two numbers def multiply(x, y): return x * y # This function divides two numbers def divide(x, y): return x / y # This function modulus two numbers def mod(x, y): return x % y # This function floor division two numbers def floor(x, y): return x // y # This function exponential two numbers def exponention(x, y): return x ** y print("Select operation.") print("1.Add") print("2.Subtract") print("3.Multiply") print("4.Divide") print("5.modulus") print("6.floor division") print("7.exponental") while True: # take input from the user choice = input("Enter choice(1/2/3/4/5/6/7): ") # check if choice is one of the seven options if choice in ('1', '2', '3', '4','5','6','7'): try: num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: ")) except ValueError: print("Invalid input. Please enter a number.") continue if choice == '1': print(num1, "+", num2, "=", add(num1, num2)) elif choice == '2': print(num1, "-", num2, "=", subtract(num1, num2)) elif choice == '3': print(num1, "*", num2, "=", multiply(num1, num2)) elif choice == '4': print(num1, "/", num2, "=", divide(num1, num2)) elif choice == '5': print(num1, "%", num2, "=", mod(num1, num2)) elif choice == '6': print(num1, "//", num2, "=", floor(num1, num2)) elif choice == '7': print(num1, "**", num2, "=", exponention(num1, num2)) # check if user wants another calculation # break the while loop if answer is no next_calculation = input("Let's do next calculation? (yes/no): ") if next_calculation == "no": break else: print("Invalid Input")
code for today (if some of you guys cant do it): a = int(input("Enter your First number: ")) b = int(input("Enter your Second number: ")) c = input("Enter your Operation Sign: ") if c == '+': print(a + b) elif c == '-': print(a - b) elif c == '*': print(a * b) elif c == '/': print(a / b) elif c == '**': print(a ** b) else: print("Operator Not Found , 101 error")
This code is perfect for students who are beginners. It is related to the concepts we have previously studied. I have noticed that many students provide code with user input, but we have not studied that yet. This is the easy version of the code provided below: code: # Simple calculator num1 = 3 num2 = 5 # Addition print("Addition:", num1, "+", num2, "=", num1 + num2) print() # for space. # Subtraction print("Subtraction:", num1, "-", num2, "=", num1 - num2) print() # Multiplication print("Multiplication:", num1, "*", num2, "=", num1 * num2) print() # Exponential print("Exponential:", num1, "**", num2, "=", num1 ** num2) print() # Division print("Division:", num1, "/", num2, "=", num1 / num2) print() # Modulus print("Modulus:", num1, "%", num2, "=", num1 % num2) print() # Floor Division print("Floor Division:", num1, "//", num2, "=", num1 // num2) Output: Addition: 3 + 5 = 8 Subtraction: 3 - 5 = -2 Multiplication: 3 * 5 = 15 Exponential: 3 ** 5 = 243 Division: 3 / 5 = 0.6 Modulus: 3 % 5 = 3 Floor Division: 3 // 5 = 0 Also you have to Run on your machines.(Thanks YOU!)
Wow Bhai bahut aasan bhasa me samjha rahe ho aap . Mai bahut easy samjh jata hu. Mai apne life me Aisha video kabhi nahi dekha . Thanks Bhai . God bless you
# Define a function for each operation def add(x, y): return x + y def subtract(x, y): return x - y def multiply(x, y): return x * y def divide(x, y): if y == 0: return "Cannot divide by zero" return x / y # Main program loop while True: # Display menu to the user print("Options:") print("Enter 'add' for addition") print("Enter 'subtract' for subtraction") print("Enter 'multiply' for multiplication") print("Enter 'divide' for division") print("Enter 'quit' to end the program") user_input = input(": ") if user_input == "quit": break elif user_input in ["add", "subtract", "multiply", "divide"]: num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: ")) if user_input == "add": print("Result:", add(num1, num2)) elif user_input == "subtract": print("Result:", subtract(num1, num2)) elif user_input == "multiply": print("Result:", multiply(num1, num2)) elif user_input == "divide": print("Result:", divide(num1, num2)) else: print("Invalid input")
# I do coding in my "vs code" , so i am sharing this code in your comment section, i hope you will like it. # This is exercise of day 1 # We have to make a calculator for basic calculations print("Enter the value of first number") a = int(input()) print("Enter the value of Second number") b = int(input()) print("Enter the operators for calculation") d = str(input()) if (d == "+"): print("The addition of first and second number is ",a+b) elif (d == "-"): print("The subtraction of first and second number is ",a-b) elif (d == "*"): print("The multiplication of first and second number is ",a*b) elif (d == "/"): print("The division of first and second number is ",a/b) else: print("You have enter wrong operator, please renter coorect operator") print("you can only enter (+,-,*,/) only these operators")
a = int(input("Enter the first number: ")) b = int(input("Enter the second number: ")) c = (a+b) d = (a-b) e = (a*b) f = (a/b) g = (a**b) h = (a//b) x = int(input("Enter 1 for addition and 2 for subtraction and 3 for multiplication and 4 for devition and 5 for exponent and 6 for floor division: ")) if x == 1: print(c) elif x == 2: print(d) elif x == 3: print(e) elif x == 4: print(f) elif x == 5: print(g) elif x == 6: print(h)
#Exercise 1: Calculator using Python a = 105 b = 11 print("a = ", a) print("b = ", b) print("Addition of a and b is (a + b) = ",a + b) print("Substraction of a and b is (a - b) = ",a - b) print("Multiplication of a and b is (a * b) = ",a * b) print("Division of a and b is (a / b) = ",a / b)
you are right hum bhi isko kiye lekin thora sa diffrent hum thoda sa research kiye aur humko input ke bare me pata chala is liye hum a = int(input("Enter your number ")) and b = int(input("Enter your number ")) likha B)
# Exercise 1 - Create a Calculator Create a calculator capable of performing addition, substraction, multiplication and division operations on two numbers. Your program should format output in a readable manner! a = int(input("Enter A number ")) b = int(input("Enter second number ")) add = a + b print("Addition of", a, "and", b, "is", add) sub = a - b print(" Subtraction of", a, "and", b, "is", sub) multiply = a * b print(" Multiplication of", a, "and", b, "is", multiply) division = a / b print(" Division of", a, "and", b, "is", division)
not efficient code :( This would be more efficient: #Exercise Calculator while True: try: print(f' [=] {eval(input(" [+] Enter your mathematical statement: "))}') except Exception: print(" [X] Alphabets aren't allowed")
#solved By Yash print("Enter two numbers :") a=int(input()) b=int(input()) print("The sum of ",a,"and",b,"is",a+b) print("The subtraction of ",a,"amd",b,"is",a-b) print("The product of ",a,"and",b,"is",a*b) print("The division of ",a,"and",b,"is",a/b) Harry Bhai ka replit page crash ho gya 404 error 😂baad mai replit pr comment karunga 😂
# 7> MAKING A SIMPLE CALCULATOR x=int(input("Enter your 1st number :")) y=int(input("Enter your 2nd number :")) alpha = (x+y,x-y,x*y,x/y,x//y,x%y,x**y) print(alpha)
Thanks for this amazing Python Course and love from Bulandshahr Harry Bhaiya 😊 this is my first exercise program :- # CALCULATOR FOR PERFORMING BASIC MATHEMATICAL OPERATIONS ON TWO NUMBERS :) Num1=eval(input("Enter First Number :- ")) Num2=eval(input("Enter Second Number :- ")) Symbol=str(input("Enter The mathematical symbol of the operations you want to perform like \"+\", \"-\", \"*\", \"/\" :- ".title())) if Symbol=="+": Add=Num1+Num2 print("Your Addition Of That Numbers :- ", Add) elif Symbol=="-": Sub=Num1-Num2 print("Your Subtraction Of That Numbers :- ", Sub) elif Symbol=="*": Mul=Num1*Num2 print("Your Multiplication Of That Numbers :- ", Mul) elif Symbol=="/": Div=Num1/Num2 print("Your Dividation Of That Numbers :- ", Div) else: print("Sorry, You type another symbol :()".title())
a = int(input("Enter 1st number ")) b = int(input("Enter 2nd number ")) print("Addition of the two numbers are ", a+b) print("Subtraction of the two numbers are ", a-b) print("Division of the two numbers are ", a/b) print("Multiplication of the two numbers are ", a*b) print("Power of 1st number to 2nd number are ", a**b) print("remainder of 1st number to 2nd number are ", a % b) print("Floor division of the two numbers are ", a//b)
a = 10.5 b = 7.5 print("The Addtion of ", a , "and ", b , " is =" , a+b) print("The Substrection of ", a , "and ", b , " is =" , a-b) print("The Myltipication of ", a , "and ", b , " is =" , a*b) print("The Division of ", a , "and ", b , " is =" , a/b)
a=int(input("please enter a number to perform calculation :")) b=int(input("please enter a number to perform calculation :")) c=int(0) variable=int(input("select a operatio to be performed /n 1 for : addition /n 2 for : substraction /n 3 for : multiplication /n 4 for : devision /n 5 for : modulo ")) if(variable==1) : c=a+b print(c) #break elif(variable==2) : c=a-b print(c) #break elif(variable==3) : c=a*b print(c) #break elif(variable==4) : c=a/b print(c) #break elif(variable==5) : c=a%b print(c) #break else : print("you have entered a wrong choice please re-enter your choice")
Harry vai this is the best course on python on entire youtube platform. I am doing this 100 days of python and sigma web-development course together. Love you harry vai ❤❤
you can make it by, Print("Welcome To simple calculator 100daysofcode"). Num1 = int(input("Enter the first number"))num2 = int(input("Enter the second number")) op = int(input("enter the operator") if op == "+" print (f"{num1} + {num2} if op == "-" print (f"{num1} - {num2} if op == "/" print (f"{num1 / {num2} if op == "*" print (f"{num1} * {num2} print ("Thanks Codewithharry for giving this exercise")
This is me in my other account. The code is incorrect,here is the new code import time #100 DAYS OF CODE #1 EXERCISE print("Welcome to The 100 days of Code #1 Exercise ") num1 = int(input("Enter the first number: ")) op = input("Enter The Operator: ") num2 = int(input("Enter the second number: ")) if op == "+": result = num1 + num2 print(f"{num1} + {num2} = {result}") elif op == "-": result = num1 - num2 print(f"{num1} - {num2} = {result}") elif op == "*": result = num1 * num2 print(f"{num1} * {num2} = {result}") elif op == "/" or op == "÷": if num2 != 0: result = num1 / num2 print(f"{num1} ÷ {num2} = {result}") else: print("Cannot divide by Zero...") else: print("Invalid operator...") time.sleep(2) print("Thank You CodeWithHarry For the Exercise") # Note : i made this code by my own and i took help from ChatGPT
a=int(input("Enter the first digit:")) b=int(input("Enter the first digit:")) x=int(input("Enter the operation to be performed: 1.+ 2.- 3.* 4./ 5.// 6.** ")) if x==1: print(a+b) elif x==2: print(a-b) elif x==3: print(a*b) elif x==4: print(a/b) elif x==5: print(a//b) elif x==6: print(a**b) else: print("Enter a valid operation!")
number1 = int(input("Enter a number:")) symbol = str(input("Enter a symbol:")) number2 = int(input("Enter another number:")) if symbol == '+': print(number1 + number2) if symbol == '-': print(number1 - number2) if symbol == '*': print(number1 * number2) if symbol == '/': print(number1 / number2) if symbol == '**': print(number1**number2) if symbol == '%': print(number1 % number2) if symbol == '//': print(number1 // number2) calculator for addition, subtraction, division and multiplication
a simple calc : a = int(input("enter first number >>> ")) b = int(input("enter second number >>> ")) c = input("enter operators >>> ") if(c == "+"): print(a + b) elif(c == "-"): print(a - b) elif(c == "*"): print(a*b) elif(c == "/"): print(a/b)
a = input("enter first number : ") a1 = input ("enter second number : ") sum = int(a) + int(a1) print(sum , "is the addition") sum = int(a) - int(a1) print(sum , "is the substraction") sum = int(a) / int(a1) print(sum , "is the quotient") sum = int(a) * int(a1) print(sum , "is the multiplication") sum = int(a) ** int(a1) print(sum , "is the expermentol") sum = int(a) // int(a1) print(sum , "is the remender")
print("ok sir") a = int(input("enter first number ")) b = int(input("enter second number ")) c = int(input("enter 1 for addition /nenter 2 for multiplication /enenter 3 for division /n enter 4 for minus /nenter 5 for exponential")) if c == 1 : print(a+b) elif c ==2 : print(a*b) elif c == 3 : print(a/b) elif c== 4 : print (a-b) elif c == 5: print(a**b) else : print("error")
Review: 🌟🌟🌟🌟🌟5 stars. Guys I have reaches day 35 and this is very Amazing and easily understandable course. By harry bhaiya. 😊😊😊😊😊😊😊😊😊😊 You can also watch without wasting time. ❤❤❤❤❤❤ Inke video se define function, and recursion jaise topics easily sm aa jate hai. 🎉🎉🎉🎉🎉🎉🎉 Thanku harry bhaiya 😁😁😁😁. Abi muje college me 3 months hi hue hai and I am expert in my class. I have already learn basics of python and now I am at advance. Bhaiya ap data science se related aur subjects pe video bnayenge to hme bhut acha lgega. Jaise DSA IN PYTHON, statistics, r, sas, powerbi, tableau and baki jo bi semesters subject hote hai for data science. Thanku bahiya🎉🎉🎉🎉🎉🎉❤❤❤😀😃😃😁😁😃😁😃😀😀😁😀😊😀😁😃😁🙃😊🙂😊🙂😉🙂😆😀😁😁🙂😁🙂🤩🤩🙂🤩🤩🤩🤩🤩🤩🙂🤩🤭🙃🤭🙃🤭🙃🤭
a = 2 b = 3 print(f"Addition of {a} and {b} is ", a + b) print(f"Subtraction of {a} from {b} is ", b - a) print(f"Multiplication of {a} and {b} is ", a * b) print(f"{a} when divided by {b} is ", a / b) print(f"{a} when floor divided by {b} is ", a // b) print(f"exponent of {a} applied oon {b} is ", b**a
Operators Operators in Python are symbols or special keywords used to perform operations on operands. They allow you to manipulate values and variables to produce a result. Python supports various types of operators, including arithmetic, comparison, logical, assignment, bitwise, membership, and identity operators. Let's explore each type in detail: 1. Arithmetic Operators: Arithmetic operators are used to perform mathematical operations such as addition, subtraction, multiplication, division, modulus, and exponentiation. Addition + Subtraction - Multiplication * Division / Modulus % Exponentiation ** Floor Division // 2. Comparison Operators: Comparison operators are used to compare values. They return a Boolean value (True or False) based on the comparison result. Equal to == Not equal to != Greater than > Less than < Greater than or equal to >= Less than or equal to 6. Membership Operators: Membership operators are used to test whether a value is present in a sequence (such as lists, tuples, or strings). in: Returns True if the specified value is present in the sequence. not in: Returns True if the specified value is not present in the sequence. 7. Identity Operators: Identity operators are used to compare the memory locations of two objects. is: Returns True if both operands point to the same object. is not: Returns True if both operands do not point to the same object.
a = int(input("enter your 1st no ")) b = int(input("enter your 2nd no ")) operator = input("Enter operation ") c = operator if (c == '+'): print("addition of a and b") print(a + b) elif c == '-': print("subtraction of a and b") print(a - b) elif c == '*': print("multiplication of a and b") print(a * b) elif c == '/': print("division of a and b") print(a / b) else: print("Invalid operation")
i did not use replet thats why directly write code here #create a calculator a=int(input()) b=int(input()) 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) print("the value of",a,"//",b,"is:",a//b) print(a**3) Thank You Sir Ur Awesome!!!!!!
# Taking input from user a = input("Enter a number: ") a = int(a) b = input("Enter another number: ") b = int(b) # Arithmetic Operations print("The sum of given numbers is", a + b) print(f"The result after subtracting {a} from {b} is {b - a} and the result after subtracting {b} from {a} is {a - b}") print("Multiplied result is", a * b) print("Divided result is", a / b)
a= input("what opration do you want to do?(in words) ") b= input("first number=") c= input("second number=") if a == "Add" or a=="add" or a=="addition" or a=="Addition": print(float(b)+float(c)) elif a=="sub" or a=="Sub" or a=="subtraction" or a=="Subtraction" or a=="minus" or a=="Minus": print(float(b)-float(c)) elif a=="multiply" or a=="Multiply" or a=="multiplication" or a=="Multiplication": print(float(b)*float(c)) elif a=="divide" or a=="Divide" or a=="division" or a=="Division": print(int(b)/int(c))
a=int(input("enter first number:")) b=int(input("enter second number:")) print("the sum of two numbers is",a+b) print("the subtraction of two numbers is",a-b) print("the multiplication of two numbers is",a*b) print("the divison of two numbers is",a/b) print("the power of two numbers is",a**b) print("the modulus of two numbers is",a%b) print("the floor divison of two numbers is",a//b)
Thank you. Here's my solution. print("first number") x=int(input()) print("second number") y=int(input()) print("calculator") print("Sum of x and y: ", x+y) print("Minus of x and y: ",x-y) print("multiple of x and y: ",x*y) print("square of x and y: ",x**y) print("divison of x and y: ",x/y) print("floor of x and y: ",x//y) print("mod of x and y: ",x%y)
a = int(input("Enter the first number : ")) b = int(input("Enter the second number : ")) sum = a + b print("The sum of the two numbers is ", sum) sub = a - b print("The subtraction of the two numbers is ", sub) mul = a * b print("The multiplication of the two numbers is ", mul) div = a / b print("The division of the two numbers is ", div)
ans of this is as follows: operation = input(''' Please type in the math operation you would like to complete: + for addition - for subtraction * for multiplication / for division ''') number_1 = int(input('Enter your first number: ')) number_2 = int(input('Enter your second number: ')) if operation == '+': print('{} + {} = '.format(number_1, number_2)) print(number_1 + number_2) elif operation == '-': print('{} - {} = '.format(number_1, number_2)) print(number_1 - number_2) elif operation == '*': print('{} * {} = '.format(number_1, number_2)) print(number_1 * number_2) elif operation == '/': print('{} / {} = '.format(number_1, number_2)) print(number_1 / number_2) else: print('You have not typed a valid operator, please run the program again.')
print('enter the first number') a=int(input()) print('enter the operation') d = str(input()) print('enter the second number') b=int(input()) if (d=="+"): print(a+b) elif (d=="x" or d=="*"): print(a*b) elif (d=="/"): print(a/b) elif (d=="-"): print(a-b) else: print('invalid operator')
first = 23 second = 10 ans1 = first * second print("Multiplication of",first ,"and",second ,"is", ans1) ans2 = first + second print("Addition of",first ,"and",second ,"is",ans2) ans3 = first - second print("sub of",first ,"and",second ,"is",ans3) ans4 = first / second print("div of",first ,"and",second ,"is",ans4)
a=int(input("enter the first number =")) b=int(input("enter the srcond number = ")) op=(input("chose your oprater to perform action ")) if (op=="+"): print("sum of these numbers are =",a+b) elif(op=="-"): print("sub of these numbers are =",a-b) elif(op=="*"): print("multiply of these numbers are =",a*b) elif(op=="/"): print("division of these numbers are =",a/b) else: print("enter the valid number")
My ans) a=int(input("Enter first number:")) b=int(input("Enter second number:")) c=input("choose a number q,w,e,r") if c=="q": q=a+b print(q) elif c=="w": w=a-b print(w) elif c=="e": e=a*b print(e) elif c=="r": r=a/b print(r)
excricse 1 solution: x=float(input("Enter the first number: ")) z=float(input("Enter the second number: ")) n=input("What do you want: ") a= x+z b= x-z c=x*z d=x/z if n=='+': print(a) if n=='-': print(b) if n=='*': print(c) elif n=='/': print(d)
a=15 b=7 print("add two number of addition" ,(a+b)) print("add two number of subtraction" ,(a-b)) print("add two number of multipication" ,(a*b)) print("add two number of Exponential" ,(a**b)) print("add two number of modules" ,(a%b)) print("add two number of floor Divition" ,(a//b)) print("add two number of Divition" ,(a/b))
A = input("Enter your number") B = input("Enter your number") Ans = int(A)+int(B) print("The addition is " , Ans) A = input("Enter your number") B = input("Enter your number") Ans1 =int(A) - int(B) print("The subcration is" , Ans1) A = input("Enter your number") B = input("Enter your number") Ans2 = int(A) / int(B) print("The Division is" , Ans2) A = input("Enter your number") B = input("Enter your number") Ans3 =int(A) % int(B) print("The modulus is" , Ans3) A = input("Enter your number") B = input("Enter your number") Ans4 =int(A) * int(B) print("The multiplication is" , Ans4) A = input("Enter your number") B = input("Enter your number") Ans5 =int(A) // int(B) print("The floor Division is" , Ans5) A = input("Enter your number") X = input("Enter the power for number") Ans6 =int(A) ** int(X) print("The Power of number is" , Ans6)
a=5 b=8 print(a) print(b) print("the sum of these two numbers are :",a+b) print("the subtraction value of these two numbers are :",a-b) print("the division valuse of these two numbers are : ",a/b) print("the multiplied value of these two numbers are : ",a*b)