Showing posts with label Variable Assignment in Python. Show all posts
Showing posts with label Variable Assignment in Python. Show all posts

Wednesday, April 22, 2020

Variable Assignment in Python

Variable Assignment

Think of a variable as a name attached to a particular object. In Python, variables need not be declared or defined in advance, as in the case of any other programming languages. To create a variable, you just assign it a value and then, start using it. The assignment operator is done with a single equals sign (=).
>>> score = 85

This is read or interpreted as “score is assigned the value 85”. Once this is done, the score can be used in a statement or expression and its value will be substituted.
>>> print(score)
85

Later, if you change the value of score and use it again, the new value will be substituted instead.
>>> score = 65
>>> print(score)
65
>>> score
65

Python also allows chained assignment, which makes it possible to assign the same value to several variables simultaneously.
>>> x = y = z = 500
>>> print(x,y,z)
500 500 500

The chained assignment above assigns  500  to the variables x, y, and z simultaneously.

I am currently accepting programming work inventory system, enrollment system, accounting system, payroll system, information system, website design and development using WordPress, IT projects, school and application development, programming projects, thesis, and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is +63 (034) 4335675.

Here in Bacolod City, Negros Occidental I also accepting computer repair, web development using WordPress, Computer Networking, and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com

My programming website is http://www.jakerpomperada.blogspot.com

I am also a book author you can purchase my books on computer programming and information technology in the following links below.

https://www.unlimitedbooksph.com/