0% found this document useful (0 votes)
12 views1 page

Python Variable Operations Example

The document outlines a Python program that performs a series of arithmetic operations based on user input. It starts with a predefined variable, modifies it, and then multiplies, adds, subtracts, and divides it using the user's input. Finally, it outputs the result after a series of timed pauses.

Uploaded by

Rion Saha Shyam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Python Variable Operations Example

The document outlines a Python program that performs a series of arithmetic operations based on user input. It starts with a predefined variable, modifies it, and then multiplies, adds, subtracts, and divides it using the user's input. Finally, it outputs the result after a series of timed pauses.

Uploaded by

Rion Saha Shyam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import time

variable=100 #This is a set value for the program


variable=variable-80 #This shows that the variable has changed by the program
variable1=int(input("So what number do you like? ")) #This shows that the variable here is an
input variable
print("I will first start off by multiplying your number by 20")
#Now this is the variable part finished now to move on to the operation parts
oputie=variable*variable1 #This shows the variables are either adding, subtracting, multiplying or
dividing
print("Multiplying your number with 20...")
[Link](5)
oputie=30+oputie #The variable can also use operations to its own variable
print("Adding your number with 30...")
[Link](5)
ouptie=40-oputie #Now I am multiplying the variable 'ouptie' by 40
print("Subtracting your number by 40")
[Link](5)
ouptie=50/ouptie #Finally I am dividing the variable 'ouptie' with 50
print("Dividing your number by 50")
[Link](5)
#You see, the variable has changed many times in this process so after we did all we could do, we
can do the last part which is to output the result.
print("YES! I GOT YOUR RESULT!")
print("Your result is", ouptie)
print("Thank you for using me. Good bye")

You might also like