Fun arithmetic with “Python”

In programming, there is often a process that operates on several values so that a new value is generated. For example, suppose we operate on the addition of two numbers, namely 3 and 5. The result of the operation of 3+5 equals to 8. The + sign in the 3+5 operation is also called the operator. Similarly, the -, *, / and so on are all including operators. So in this case the operator function is to operate on two or more values so that a new value is generated. Python has several types of operators, namely arithmetic operators, string operators, logical operators, and relational operators.

Well, one of them is Arithmetic Operations, which operates on values in the form of numbers (can be integer or float data types). In a mathematical expression, there can be one or more arithmetic operators.

This form of arithmetic operations can be applied in the Python programming language. Let’s practice right away. For example, we will solve the problem of a problem, namely, Mr. Rosid traveled from city A to city D which is 800 km away by car via toll road. If the fuel consumption of Mr. Rosid is 1:10 (1 liter of fuel can be used to cover 10 km), so how many liters of gasoline are needed for the trip? How to answer it? Check out the program below.

So later after we run programming like the picture above it will produce an output that will answer the above problem.

After that, the result is 80 liters. Python does make it easier for us in all forms of programming that we want with an easy-to-understand language. Can be used in Arithmetic operations is one of the little things we can do in “Python”. Learning the programming language “python” will be able to develop if we try to solve problems in a program.

--

--

--

Nama: Aradea Tiyu Athama, NIM:K3521011, Email: athamaradea27@student.uns.ac.id, Institusi : UNS

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

6 Ways to Make Quip Better

Evaluation Method

Use iperf to benchmark the transfer speeds between two hosts.

A Quick Guide To DBMS (Database Management System)

A QUICK GUIDE TO DBMS

Welcome to MediumDesk

Flutter on Raspberry Pi (mostly) from Scratch

Post-mortem: 29 Jan options exercise bug

AWS Cost Optimization

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aradea T. Athama

Aradea T. Athama

Nama: Aradea Tiyu Athama, NIM:K3521011, Email: athamaradea27@student.uns.ac.id, Institusi : UNS

More from Medium

An Open Letter To Snowplow Operators In The City Of Akron And Everywhere Else In Ohio

The first impression of DMM English.

Time is constant —it only changes.

SECOND SKIN VIOLET | COLLABORATIVE UNIT