Python Project for beginners #6| Calculator -Complete Code | Python for Beginners

Поділитися
Вставка
  • Опубліковано 16 гру 2024

КОМЕНТАРІ • 83

  • @nicksonkiprotich5070
    @nicksonkiprotich5070 Рік тому +6

    Hey Jenny, thank you so much for these lectures. You really are a blessing. One ask though, could you please dedicate a lecture to teach everything on JSON in relation to python?

  • @devSackey
    @devSackey Рік тому +8

    import os
    def addition(a, b):
    result = a + b
    return result
    def multiplication(a, b):
    result = a * b
    return result
    def division(a, b):
    result = a / b
    return result
    def subtraction(a, b):
    result = a - b
    return result
    def calculator():
    num1 = int(input("Enter first number: "))
    print("+
    -
    *
    /
    ")
    continue_program = True
    while continue_program:
    operator = input("Pick an operation: ")
    num2 = int(input("Enter next number: "))
    if operator == "+":
    output = addition(num1, num2)
    print(f"{num1} + {num2} = {output}")
    elif operator == "*":
    output = multiplication(num1, num2)
    print(f"{num1} * {num2} = {output}")
    elif operator == "/":
    output = division(num1, num2)
    print(f"{num1} / {num2} = {output}")
    elif operator == "-":
    output = subtraction(num1, num2)
    print(f"{num1} - {num2} = {output}")
    else:
    print("Invalid operator")
    play_again = input(f"Enter 'y' to continue calculation with {output} or 'n' to start a new calculation or 'x' to exit ").lower()
    if play_again == 'y':
    num1 = output
    elif play_again == 'n':
    continue_program = False
    os.system('cls')
    calculator()
    else:
    continue_program = False
    print("Bye")
    calculator()

  • @bhautikhirpara007
    @bhautikhirpara007 3 місяці тому +1

    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):
    return a / b
    opp_dict = {
    "+":add,
    "-":subtract,
    "*":multiply,
    "/":divide
    }
    def calculator():
    num1= float(input("enter first number : "))
    start = False
    while not start:
    for symbol in opp_dict:
    print(symbol)
    oppration = input("what oppration want to do : ")
    num2 = float(input("enter next number : "))
    output = opp_dict[oppration](num1,num2)
    print(output)
    choose = input("Type 'y' for more oppration with output, type 'n' to new oppration, type 'x' to exit : ")
    if choose == "y":
    num1 = output
    elif choose == "n":
    start = True
    calculator()
    else:
    start = True
    print("Good bye")
    calculator()

  • @waqarrajpt7031
    @waqarrajpt7031 Рік тому +2

    Great ma'am
    Thanks so much

  • @BnFh-hh1ht
    @BnFh-hh1ht 9 місяців тому

    Thank you so much! I have followed you do this project and it's successful.

  • @pkr1kajdjasdljskjdjsadjlaskdja

    #without use function without of switch case make calculator
    x = "t"
    while x == "t":
    c = int(input("enter first name"))
    i = True
    while i:
    operation = input("what you want to operation")
    b = int(input("enter second name"))
    if operation == "+":
    print(c, "+", b)
    c = c + b
    print("=", c)
    elif operation == "-":
    print(c, "-", b)
    c = c - b
    print("=", c)
    elif operation == "/":
    print(c, "/", b)
    c = c / b
    print("=", c)
    elif operation == "*":
    print(c, "*", b)
    c = c * b
    print("=", c)
    elif operation == "%":
    print(c, "%", b)
    c = c % b
    print("=", c)
    else:
    print("invalid input")
    x = input("y for continue or n for not continue")
    if x == "y":
    i = True
    else:
    break
    x = input(" more calculate or not if calculate than type t ")
    ###### 2nd method # use function make calculator
    def sum(a, b):
    return a + b
    def dif(a, b):
    return a - b
    def multi(a, b):
    return a * b
    def divide(a, b):
    return a / b
    def modulo(a, b):
    return a % b
    x = "t"
    while x == "t":
    c = int(input("enter first name"))
    i = True
    while i:
    operation = input("what you want to operation")
    b = int(input("enter second name"))
    if operation == "+":
    print(c, "+", b)
    c = sum(c, b)
    print("=", c)
    elif operation == "-":
    print(c, "-", b)
    c = dif(c, b)
    print("=", c)
    elif operation == "/":
    print(c, "/", b)
    c = divide(c, b)
    print("=", c)
    elif operation == "*":
    print(c, "*", b)
    c = multi(c, b)
    print("=", c)
    elif operation == "%":
    print(c, "%", b)
    c = modulo(c, b)
    print("=", c)
    else:
    print("invalid input")
    x = input("y for continue or n for not continue")
    if x == "y":
    i = True
    else:
    break
    x = input(" more calculate or not if calculate than type t ")

  • @marvelousncube
    @marvelousncube Рік тому +1

    I did this using object oriented programming ,please teach us object oriented programming mam😊

  • @Technoacademy969
    @Technoacademy969 Рік тому

    Thank you when i was yuniversity
    Your vidio helped me thank you sister

  • @AnonymousCoder7
    @AnonymousCoder7 Рік тому

    So I was missing my newspaper lately . Good that I found it here ! 😋😋

  • @DARK_RYZEN
    @DARK_RYZEN 11 місяців тому

    condition = True
    while condition:
    A = int(input("Enter the first number: "))
    print("+
    -
    %
    *")
    operation = input("Enter an operation symbol: ")
    B = int(input("Enter the second number: "))
    if operation == "+":
    C = A + B
    print(C)
    elif operation == "-":
    C = A - B
    print(C)
    elif operation == "*":
    C = A * B
    print(C)
    elif operation == "%":
    C = A % B
    print(C)
    ask = input(f"Do you want to continue with {C}? 'y' to continue, 'no' to start a new calculation, or 'x' to exit: ")
    if ask == "y":
    D = int(input("Enter a third number: "))
    if operation == "+":
    C = C + D
    print(C)
    elif operation == "-":
    C = C - D
    print(C)
    elif operation == "*":
    C = C * D
    print(C)
    elif operation == "%":
    C = C % D
    print(C)
    elif ask == "no":
    condition = True
    elif ask == "x":
    break

  • @CodingBRO
    @CodingBRO Рік тому +4

    num1=int(input('Enter the first no. : '))
    pick=input(' +
    -
    *
    /
    Pick a operation: ')
    num2=int(input('Enter the second no.: '))
    match pick:
    case '+':ans=num1+num2
    case '-':ans=num1-num2
    case '*':ans=num1*num2
    case '/':ans=num1/num2
    case _:print("invalid operator")
    print(ans)
    response=input("Enter 'y' to continue with "+str(ans)+ " or 'n' to start new calculation or 'x' to exit:")
    while True:
    while response=='y':
    pick=input(' +
    -
    *
    /
    Pick a operation: ')
    num2=int(input('Enter the second no.: '))
    match pick:
    case '+':ans=ans+num2
    case '-':ans=ans-num2
    case '*':ans=ans*num2
    case '/':ans=ans/num2
    case _:print("invalid operator")
    print(ans)
    response=input("Enter 'y' to continue with "+str(ans)+ " or 'n' to start new calculation or 'x' to exit:")
    while response=='n':
    num1=int(input('Enter the first no. : '))
    pick=input(' +
    -
    *
    /
    Pick a operation: ')
    num2=int(input('Enter the second no.: '))
    match pick:
    case '+':ans=num1+num2
    case '-':ans=num1-num2
    case '*':ans=num1*num2
    case '/':ans=num1/num2
    case _:print("invalid operator")
    print(ans)
    response=input("Enter 'y' to continue with "+str(ans)+ " or 'n' to start new calculation or 'x' to exit:")
    if response=='x':
    print('Thanks')
    break
    "mam how is this.
    plz correct me if i am wrong"
    thanks for videos
    😊😊😊

  • @Yourcodingfriendsaruk
    @Yourcodingfriendsaruk 11 місяців тому

    thanks you mam

  • @AkhilGeorge-v7e
    @AkhilGeorge-v7e Рік тому +2

    Mam can you create a what's app group or a doubt class for Python
    I have a few doubts

  • @potrakandimanojkumar2693
    @potrakandimanojkumar2693 Рік тому

    𝑳𝒐𝒗𝒆 𝒇𝒓𝒐𝒎 𝒐𝒅𝒊𝒔𝒉𝒂...❤

  • @careerwhere4508
    @careerwhere4508 28 днів тому

    Ma'am Namaste and thanks
    currently i am using 3.13.0 python version ,while running program on Pycharm 2024 using os mudule and os.system('cls') ,it isnot working on my lapton window 11
    what should be the reason?

  • @sethup5904
    @sethup5904 Рік тому

    Thank you mam❤️

  • @sinisteryt459
    @sinisteryt459 Рік тому

    Thank you mam

  • @pullaashlesha8136
    @pullaashlesha8136 Рік тому

    Oops concept in python plz mam

  • @dikshateware03
    @dikshateware03 4 місяці тому

    how you make the code intended by selecting it? what key you use?

  • @kushalpha4442
    @kushalpha4442 Рік тому

    Thankyou mam❤️

  • @tamannaist
    @tamannaist Рік тому

    Ma'am please complete c++series oops concept programming

  • @anurag__yadav940
    @anurag__yadav940 Рік тому

    Nice goggles 😚

  • @artist_r_21
    @artist_r_21 Рік тому +1

    Can you teach VEX .

  • @ShubhamGaming-wq9om
    @ShubhamGaming-wq9om Рік тому

    Love you mam❤😘😘

  • @Whiro__08
    @Whiro__08 Рік тому +1

    Lob you mam🥰😍😘

  • @gumanmahar6414
    @gumanmahar6414 Рік тому

    Ma'am
    Good Evening
    Please make an Excel Course Advance Level.

  • @sudhakarjalla9067
    @sudhakarjalla9067 Рік тому

  • @pullaashlesha8136
    @pullaashlesha8136 Рік тому

    Mam plz continue oops concept core and advanced python mam plz plz mam plz do that if you do that we r really thankfully and praying for you mam plzmam do core python videos

  • @Vinaykkkk
    @Vinaykkkk Рік тому

    mam,what is the short cut key to move the block of code into indentation?

  • @yogichappa3347
    @yogichappa3347 Рік тому

    I love your voice mam❤❤😊

  • @prashanthrao519
    @prashanthrao519 Рік тому

    provide the notes of this project on description link

  • @fitnessfusion104
    @fitnessfusion104 Рік тому

    maam how many vidoes are left in this course

  • @krishnateja6670
    @krishnateja6670 Рік тому

    mam when will this course will end

  • @sharanabasavasharana2810
    @sharanabasavasharana2810 Рік тому

    Next video

  • @mrsbk03
    @mrsbk03 Рік тому

    What if it's a white whole ?
    That's emitting the energy from its Black hole

  • @zolarpromaxcomedy3066
    @zolarpromaxcomedy3066 Рік тому

    How can I contact you for classes

  • @sharuk98ala
    @sharuk98ala Рік тому

    Babe! You are gorgeous ❤

  • @deepaksingh7287
    @deepaksingh7287 Рік тому

    don't know why, i am interested to read some news today 😅😅

  • @indrarajmodi1232
    @indrarajmodi1232 Рік тому

    Ma'am aap Hindi me bhi btaya karo n. C me Data structure ek bar Hindi me video bna do n please. English me samjh nhi aata hai. Please 🙏🙏🙏

    • @indrarajmodi1232
      @indrarajmodi1232 Рік тому

      Exam hai and kuchh samjh nhi aaya hai so please please 🙏🙏🙏🙏

  • @Aaloochaap
    @Aaloochaap Рік тому

    Ma'am if a student has completed his BCCA is he eligible for NIMCET Exam?? Help🗿🙏

  • @mgjdb
    @mgjdb Рік тому

    Nice t shirt mam😂😂

  • @pythonassignment
    @pythonassignment Рік тому

    2nd view

  • @umangupadhyay4335
    @umangupadhyay4335 Рік тому +1

    Mam aapse sadi krne ke lie kitni permonth salary chaiye ?

  • @akumallalokesh3423
    @akumallalokesh3423 Рік тому

    mama java course

  • @SONUkumar-eg4xo
    @SONUkumar-eg4xo Рік тому

    Hii

  • @gaysergyalpo8549
    @gaysergyalpo8549 Рік тому

    Hi I am from Bhutan 🇧🇹🇧🇹🇧🇹🇧🇹
    I had finished Python basics
    What should i learn next.
    Please respond me🙏🙏🙏🙏🤞

    • @marvelousncube
      @marvelousncube Рік тому +1

      Go deep in object oriented programming ,file handling, Django framework , build a massive project that will you all the basic things you've learnt

  • @SonuKumar-gt6wq
    @SonuKumar-gt6wq Рік тому

    Hallo mam

  • @parthasaradireddy9370
    @parthasaradireddy9370 Рік тому +13

    HELLO MAM ARE U MARRIED!!!

  • @ruthpersiyal
    @ruthpersiyal Рік тому

    Mam plz you tell tamil mam i am not understanding mam

  • @unknown__virus
    @unknown__virus Рік тому

    Apki koi Sister he kya ? 😊😊

  • @PrinceTewatia001
    @PrinceTewatia001 10 місяців тому

    Aapko dekhe ya pde
    Newspaper lg rhe ho

  • @bavigaddachaithureddy2341
    @bavigaddachaithureddy2341 Рік тому +1

    Mam r u married

  • @anger9589
    @anger9589 Рік тому

    First view ❤