calculatore with s , p ,... in python

You can easily perform calculations with variables in Python. Here's an example:

main.py
s = 5
p = 10
result = s + p
print(result)    # Output: 15
58 chars
5 lines

In this example, we create two variables s and p, and assign them the values 5 and 10 respectively. We then add the two variables together to get the result, which we store in another variable called result. Finally, we print the result to the screen using the print() function.

You can perform other arithmetic operations, such as subtraction (-), multiplication (*), and division (/), using variables in the same way. For example:

main.py
s = 5
p = 10
result = s * p
print(result)    # Output: 50
58 chars
5 lines

This performs a multiplication operation on s and p, and stores the result in result. We then print result to the screen, which outputs 50.

related categories

gistlibby LogSnag