Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

python program to divide the following x and y variable with the value as (6 and 2) & (3 and 0)

+3 votes
asked Dec 24, 2021 by Mike Guru Potter (160 points)

4 Answers

0 votes
answered Dec 24, 2021 by 320126511001 AGURUDARSHANSRINIVAS (140 points)
#AUTHOR : Darshan Aguru
#date : 24/12/2021

# --------- Python program to divide two numbers -------------
#answers are rounded off upto 5 decimal places

if __name__ == "__main__":
    inpA = int(input("Enter A: "))
    inpB = int(input("Enter B: "))
    
    try:
        print(round(inpA/inpB,5))
    except ZeroDivisionError:
        print("Can't divide by zero.")
0 votes
answered Dec 25, 2021 by khalid haider jafri (140 points)
x = 6

y = 2

print(x/y)
+2 votes
answered Dec 25, 2021 by S SHAKIL (230 points)
x = 6

y = 2

z = 6 / 2

print(z)
0 votes
answered Dec 25, 2021 by S SHAKIL (230 points)

x = 3

y = 0

z = 3 / 0

print(z)

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...