Python variable
Variable.
Variable is same like as container to store somethings. So In Python variable is a memory space to store data or values for use in program. The major purpose of a variable is to remember a value from one part of the program . So it can be used in another part of program.
Now we look a example of using variable in different places in
program..
temp=eval(input("Enter a temperature in celsius"))
faren_temp=9/5*temp+32
print("The temperature in Fahrenheit is ", faren_temp)
if faren_temp>212:
print("That temperature is above of Boiling point")
if faren_temp<32:
print("That temperature is below Freezing point")
>> Output >>
>> Enter a temperature in celsius >> 90
>> 194
>> That temperature is above of Boiling point.
Variable is same like as container to store somethings. So In Python variable is a memory space to store data or values for use in program. The major purpose of a variable is to remember a value from one part of the program . So it can be used in another part of program.
Now we look a example of using variable in different places in
program..
temp=eval(input("Enter a temperature in celsius"))
faren_temp=9/5*temp+32
print("The temperature in Fahrenheit is ", faren_temp)
if faren_temp>212:
print("That temperature is above of Boiling point")
if faren_temp<32:
print("That temperature is below Freezing point")
>> Output >>
>> Enter a temperature in celsius >> 90
>> 194
>> That temperature is above of Boiling point.
Thanks sir
ReplyDelete