Exercise 1: Calculator using Python (Solution) | Python Tutorial - Day #8

Поделиться
HTML-код
  • Опубликовано: 16 ноя 2024

Комментарии • 1,4 тыс.

  • @anshulkahane1319
    @anshulkahane1319 10 месяцев назад +8

    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")

  • @unknownbhai123
    @unknownbhai123 Год назад +6

    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")

    • @do_It_Together282
      @do_It_Together282 Год назад

      shabashh...!!!!!

    • @zizouking10
      @zizouking10 6 месяцев назад

      Excellent!! 👍🏻
      But how do you know this, cuz in this course he has not taught this yet ?! Where did you learn this syntax?

    • @Anonymous-vr3bb
      @Anonymous-vr3bb Месяц назад

      @@zizouking10 My be he learnt from somewhere else earlier! "Honhaar Vidyarthi"

  • @attacker_0
    @attacker_0 9 месяцев назад +6

    a= int(input("enter a number first"))
    b= int(input("enter a number second"))
    C =a+b
    Print(c)

  • @MuzammalKahloon
    @MuzammalKahloon Год назад +108

    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)

    • @ashir...897
      @ashir...897 Год назад +6

      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

    • @Gohan_Playz_
      @Gohan_Playz_ 9 месяцев назад

      bro but he didnt teach that yet@@ashir...897

    • @mampilahiri3441
      @mampilahiri3441 6 месяцев назад +6

      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

    • @riteshsharma6790
      @riteshsharma6790 3 месяца назад +3

      @@mampilahiri3441 he hasn't taught us if,else conditions yet

    • @mampilahiri3441
      @mampilahiri3441 3 месяца назад

      @@riteshsharma6790 oh sorry , 😞 😔 😟

  • @oo-tes6642
    @oo-tes6642 Год назад +101

    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 ❤️

  • @SyedaButulFatima
    @SyedaButulFatima 5 дней назад +1

    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)

  • @nirajdhungel1621
    @nirajdhungel1621 2 месяца назад +3

    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!!")

  • @suchitathakur5913
    @suchitathakur5913 7 месяцев назад +4

    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)

  • @dubbedanbis3135
    @dubbedanbis3135 11 месяцев назад +5

    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
      @GoluRajput-h1u 9 месяцев назад

      Bro how is this a calcator??
      Cause you are assigning the values by your own!

    • @dubbedanbis3135
      @dubbedanbis3135 9 месяцев назад

      @@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

  • @shivanidhyani07
    @shivanidhyani07 Год назад +8

    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)

  • @mrayaz4453
    @mrayaz4453 Год назад +136

    The best teacher on RUclips ❤️

  • @gamingbeastA2Z
    @gamingbeastA2Z Месяц назад +1

    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")

  • @toge.inumaki246
    @toge.inumaki246 Год назад +3

    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)

  • @Prati_7
    @Prati_7 15 дней назад +1

    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")

    • @meermalik7375
      @meermalik7375 13 дней назад

      hey can you please help me, how to make calculator as a program?

  • @prof.coffee5326
    @prof.coffee5326 Год назад +9

    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)

    • @ff_hr
      @ff_hr Год назад

      🥶

    • @ayaankhatib3509
      @ayaankhatib3509 Год назад +2

      I also created my calculator the same way
      Others in comment are over writing the whole code while it is damn easy!!

    • @Lilhomietiger
      @Lilhomietiger Год назад +2

      @@ayaankhatib3509 bro i am very confused , how can i solve this exercise or make a calculator?

    • @Motivationvideo207
      @Motivationvideo207 6 месяцев назад

      thank u bro

    • @NajmulHasan-l4p
      @NajmulHasan-l4p 4 месяца назад

      After scrolling so many comments I have found a well solution ❤

  • @ayaanahmad7944
    @ayaanahmad7944 2 месяца назад +1

    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)

  • @owaisnadeem2751
    @owaisnadeem2751 Год назад +62

    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

  • @WarriorAnand
    @WarriorAnand 6 месяцев назад +2

    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)

  • @Amtk22
    @Amtk22 Год назад +9

    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.

  • @WayToIqbal
    @WayToIqbal 2 месяца назад

    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..")
    ]

  • @utkarshpandey491
    @utkarshpandey491 Год назад +121

    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 😇

  • @RamandeepKaur-do3fj
    @RamandeepKaur-do3fj Месяц назад

    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))

  • @RaunakBisht-p6v
    @RaunakBisht-p6v 4 месяца назад +3

    Exercise Done 👍
    Jitna Sikhaya Hai Utna Use Karke
    Because I had just Started Programming

    • @MrRajpoot138
      @MrRajpoot138 4 месяца назад

      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

  • @kumarAjitesh
    @kumarAjitesh Год назад +7

    Following are the Time stamp at which i learnt something new
    3:16
    4:03

  • @govind9060
    @govind9060 Год назад +8

    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

  • @Butcher772
    @Butcher772 Год назад +1

    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")

  • @Kuch_Bhi-lets_explore_it
    @Kuch_Bhi-lets_explore_it Год назад +3

    3:30 Bhai ek hi dil hai kitti baar jeetoge , Love You harry Bhai ❤ Greatest teachers of all time ❤

  • @kavitabanerjee-x4k
    @kavitabanerjee-x4k 9 месяцев назад

    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)

  • @hereforfunandlove
    @hereforfunandlove Год назад +14

    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,❤

    • @SmartSquad-wg9tn
      @SmartSquad-wg9tn Год назад +2

      i too thought we were supposed to make an actual Calculator

    • @Stoiczons
      @Stoiczons 10 месяцев назад

      Exactly

    • @amulprajapati5290
      @amulprajapati5290 10 месяцев назад

      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

    • @aakashthosre9921
      @aakashthosre9921 2 месяца назад

      bro please tell me about the calculator i cant understand

  • @kajalsingh7655
    @kajalsingh7655 6 месяцев назад

    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)

  • @juanidahmed5367
    @juanidahmed5367 Год назад +40

    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.

    • @Dharmaik_Sanatani
      @Dharmaik_Sanatani Год назад +5

      Which ngo ??
      Isis 🤣🤣

    • @madtogedamaru663
      @madtogedamaru663 Год назад +1

      @@Dharmaik_Sanatani bruhhh what did he do to you?

    • @madtogedamaru663
      @madtogedamaru663 Год назад

      @@Dharmaik_Sanatani does your god teach you to abuse other people based on their relegion??

    • @munnumkhalid
      @munnumkhalid Год назад

      @@Dharmaik_Sanatani close 2nd RSS

    • @Dharmaik_Sanatani
      @Dharmaik_Sanatani Год назад +2

      @@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 🤔 ....

  • @sonaliwadkar2646
    @sonaliwadkar2646 7 месяцев назад

    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)

  • @BryanJohnson1478
    @BryanJohnson1478 Год назад +3

    the best teacher on youtube. I just made calculator in less than 10 mins

    • @HIGHHLIGHTSTV
      @HIGHHLIGHTSTV 5 месяцев назад

      bro moja samaj to sara arha ha lakin calculator nai ma rha ha samjao plz

    • @BryanJohnson1478
      @BryanJohnson1478 5 месяцев назад

      ​@@HIGHHLIGHTSTV kaise smjayun ?

  • @gurdeeppunia-n7j
    @gurdeeppunia-n7j Год назад

    a = 50
    b = 3
    print(a + b)
    print(a - b)
    print(a * b)
    print(a / b)
    easy and correct

  • @NumShu86
    @NumShu86 Год назад +7

    Best teacher ever ... Thank you Herry Bhai

  • @muhammadashir5140
    @muhammadashir5140 5 месяцев назад

    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

  • @Zen_Phantom
    @Zen_Phantom Год назад +6

    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)

    • @AyushDwivedi-jj5zh
      @AyushDwivedi-jj5zh 5 месяцев назад

      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.....

    • @Zen_Phantom
      @Zen_Phantom 4 месяца назад

      @@AyushDwivedi-jj5zh you're Just a Lil bit late

    • @AyushDwivedi-jj5zh
      @AyushDwivedi-jj5zh 4 месяца назад

      @@Zen_Phantom 😂😂

  • @hammad_h4x
    @hammad_h4x Месяц назад

    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)

  • @eaglecoderz
    @eaglecoderz Год назад +9

    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.

  • @Techfree123
    @Techfree123 2 месяца назад +1

    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)

  • @tukarampatwari5500
    @tukarampatwari5500 Год назад +10

    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))

  • @CodeWithHarry
    @CodeWithHarry  Год назад +39

    Code Backup Repository: github.com/CodeWithHarry/100-days-of-code-youtube

    • @tusharpari8467
      @tusharpari8467 Год назад

      Bhai 1 Request hai appse ki thoda sa Add Kam kar do

    • @preadeateronhunt1182
      @preadeateronhunt1182 Год назад

      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")

    • @thebruh5062
      @thebruh5062 3 месяца назад

      Present

  • @santhk1437
    @santhk1437 2 месяца назад

    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))

  • @Jaf-ss1el
    @Jaf-ss1el Год назад +11

    Thanks, Harry. I am not able to create the calculator but learning from you. will update on the 100th day

    • @mujtabahussin6369
      @mujtabahussin6369 Год назад +1

      # 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!!")

    • @ABDULMANAN-d1z
      @ABDULMANAN-d1z 8 месяцев назад

      same with me

  • @EndgameEliteChess
    @EndgameEliteChess 3 месяца назад

    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)

  • @sidzohra4055
    @sidzohra4055 Год назад +3

    One of the best teacher on RUclips ❤

  • @NewDBfan
    @NewDBfan 28 дней назад

    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

  • @cubing6550
    @cubing6550 Год назад +11

    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)

  • @Moviedekho819
    @Moviedekho819 5 месяцев назад

    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)

  • @syedagirl8144
    @syedagirl8144 Год назад +4

    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
      @elon7385 Год назад +1

      what is its use if your mindset is 1500 old and gross

    • @saransh9373
      @saransh9373 11 месяцев назад +1

      create a new language"pakthon"

    • @syedagirl8144
      @syedagirl8144 8 месяцев назад

      @@saransh9373 this represents ke jahil log bhare he india me, jinko seedhi bat me bhonkna soojta he. jahil country ke jahil log

    • @syedagirl8144
      @syedagirl8144 8 месяцев назад

      @@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

    • @syedagirl8144
      @syedagirl8144 8 месяцев назад

      @@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.

  • @m.djafar4449
    @m.djafar4449 Год назад

    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)

  • @Kuch_Bhi-lets_explore_it
    @Kuch_Bhi-lets_explore_it Год назад +7

    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

  • @HasbunAllahYousafzai
    @HasbunAllahYousafzai Месяц назад

    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))

  • @miz_mizpah9471
    @miz_mizpah9471 5 месяцев назад +15

    You didn't tell us how to create calculator

    • @chillo_829
      @chillo_829 4 месяца назад

      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😂

    • @hamidulgamerzyz
      @hamidulgamerzyz 4 месяца назад

      @@chillo_829 me to arts ka banda hu vo bhi 11th ka how to make it very confused

    • @AfreenAnsari-9876
      @AfreenAnsari-9876 3 месяца назад

      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.🥲

    • @muhammadmusa3224
      @muhammadmusa3224 3 месяца назад

      @@AfreenAnsari-9876 It has scope in engineering domain. Both C and python languages are required to excel in that domain.

  • @Shortsfortheday21
    @Shortsfortheday21 6 месяцев назад

    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))

  • @igf8235
    @igf8235 Год назад +8

    Bhai thoda basic to bata hi dete ek program ke example se😢

    • @cricketer3251
      @cricketer3251 Месяц назад

      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

  • @invinciblegamerff6349
    @invinciblegamerff6349 9 месяцев назад

    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)

  • @EntertainmentHUB099
    @EntertainmentHUB099 Год назад +8

    Thanks Alot Guys For Your Love And Support Guys Love You All 🥺💛😘✨

    • @armylover-mo6cf
      @armylover-mo6cf Год назад +1

      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 हैं इसमें

    • @ig_arunvasu
      @ig_arunvasu Год назад +1

      @@armylover-mo6cf String name = sc.next()

  • @altawfiqdip2961
    @altawfiqdip2961 9 месяцев назад +1

    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)

  • @SwayamPatel-g5i
    @SwayamPatel-g5i 6 месяцев назад +1

    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")

  • @nikhilkrishan2827
    @nikhilkrishan2827 Год назад +4

    Fun Fact: Half of the students had already learnt python from your olden videos. Even I Too!!

    • @mujtabahussin6369
      @mujtabahussin6369 Год назад

      # 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!!")

    • @DanishAkhtar-o7b
      @DanishAkhtar-o7b Год назад

      @samdarsh674 job ni lgi na teri

  • @mairamahmood6600
    @mairamahmood6600 Год назад

    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)

    • @aryyann05
      @aryyann05 Год назад

      while True krdo for repetition

  • @Nothing-Zero
    @Nothing-Zero 5 месяцев назад +12

    2024 attendance ---------->

  • @SocialStatusVideos-sl7qu
    @SocialStatusVideos-sl7qu Год назад

    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)

  • @anukoolchauhan8085
    @anukoolchauhan8085 Год назад +3

    Bhaiya day 9 ki video kbb ayegi

  • @RajMewda
    @RajMewda 11 месяцев назад

    num1=2
    num2=3
    print("sum is +", num1+num2)
    print("sum is -",num1-num2)
    print("sum is ×",num1*num2)
    print("sum is ÷ ",num1/num2)

  • @AK_Edits369
    @AK_Edits369 9 месяцев назад

    #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")

  • @PushpenderLE
    @PushpenderLE 8 месяцев назад

    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)

  • @gamerehtisham
    @gamerehtisham 5 месяцев назад

    #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))

  • @unkown4176
    @unkown4176 4 месяца назад

    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")

  • @mampilahiri3441
    @mampilahiri3441 6 месяцев назад

    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)

  • @humairashut3577
    @humairashut3577 Месяц назад

    #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 ")

  • @czgamer1345
    @czgamer1345 4 месяца назад

    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")

  • @prashantdubey6932
    @prashantdubey6932 Год назад

    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)

  • @lalkumarpandit8776
    @lalkumarpandit8776 Год назад

    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)

  • @GuruSaranSP
    @GuruSaranSP 6 месяцев назад

    #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)

  • @KBTheVideoEditor
    @KBTheVideoEditor 6 месяцев назад

    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')

  • @vinaypritwani
    @vinaypritwani Год назад

    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}")

  • @amargaming4465
    @amargaming4465 Год назад

    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)

  • @ShafayShahid-b7x
    @ShafayShahid-b7x 4 месяца назад

    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

  • @anjubislasandhu6523
    @anjubislasandhu6523 5 месяцев назад

    a=455
    b=4545
    c=a+b
    d=a*b
    e=a/b
    f=a-b
    print (c)

  • @soumitrasahoo922
    @soumitrasahoo922 Год назад +1

    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 )

  • @ansari_rehan_04
    @ansari_rehan_04 11 месяцев назад

    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")

  • @K_V0243
    @K_V0243 Месяц назад

    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)

  • @DhanwanthKumar-q2u
    @DhanwanthKumar-q2u 2 месяца назад

    print(int(eval(input("Enter values and operations:"))))

  • @10abhiraj4
    @10abhiraj4 7 месяцев назад +1

    3:25 to replicate line alt + shift + down arrow

  • @saadkhanofficial12
    @saadkhanofficial12 10 дней назад

    a=23
    b=45
    print(a+b)
    print(a*b)
    print(a/b)
    print(a-b)

  • @suraj.yadav12ij
    @suraj.yadav12ij Год назад

    a = 16
    b = 4
    print(a+b)
    print(a-b)
    print(a*b)
    print(a/b) short cut sea make a calculator

  • @AbdullahKhan-xo6fy
    @AbdullahKhan-xo6fy Год назад

    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)

  • @mrjdgamer1640
    @mrjdgamer1640 8 дней назад

    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 ❤😅

  • @aryanchauhan332
    @aryanchauhan332 Год назад

    # 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)

  • @IN_kakashi_
    @IN_kakashi_ Год назад

    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

  • @ZaraBatool-hw1jd
    @ZaraBatool-hw1jd 5 месяцев назад +1

    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")

    • @gamerehtisham
      @gamerehtisham 5 месяцев назад

      #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))

  • @akash.19933
    @akash.19933 2 месяца назад +1

    thanks kunal for idea 5:59

  • @hinasehrish7290
    @hinasehrish7290 Год назад +1

    a=1
    B=1
    Print(a+b)
    Print(a-b)
    Print(a*b)
    Print(a/b)
    Can we made like that?

  • @abhakiran7737
    @abhakiran7737 2 месяца назад

    Day 1,2,3,4,5= 29thaug,30thaug,31staug
    Day6,7,8= 1st Sep

  • @Geekgurlcode
    @Geekgurlcode 11 месяцев назад

    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)

  • @ArjunSingh-rn3wh
    @ArjunSingh-rn3wh Год назад

    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")

  • @aryandeepsinha
    @aryandeepsinha 7 месяцев назад +1

    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

  • @Ishow724
    @Ishow724 Год назад

    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)