Navbar menu
(Move to ...)
Home
Python
HTML
JavaScript
Quiz
AS400 / IBM iSeries
Contact Us
▼
Python Program - Arithmetic Operations
Arithmetic Operations
Code Snippet:
Num1=int(input("Enter 1st number:")) Num2=int(input("Enter 2nd number:")) #Addition logic Num3 = Num1+Num2 print("Sum value:",Num3) #Subtraction logic Num4 = Num1 - Num2 print("Difference value:",Num4) #Product/multiplication logic Num5 = Num1 * Num2 print("Product value:",Num5) #Single division logic Num6 = Num1 / Num2 print("Single divison value:",Num6) #Double division logic Num7 = Num1 // Num2 print("Double division value:",Num7) #Modulus logic Num8 = Num1 % Num2 print("Modulus division value:",Num8)
Copy
Arithmetic operations
Output:
Output - Arithmetic operations
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment