Python basis (four) --- variables

Python variables:


Temporary storage of data in computer memory, which means that will open up a space in memory to create variables.

Based on the data type of the variable, the interpreter allocates specified memory, and decide what data can be stored in memory.

Thus, the variable can specify different data types, these variables may be stored integer, decimal or character.

E.g:

price = 10
rating = 4.9
name = 'Mosh'
is_published = True

Note: python is a very sensitive case alphabetic languages, such as True and False bool type the first letter must be uppercase


for example:

eg

A Patient named in the Check WE John Smith
of He's 20 years Old and new new IS A Patient
asked to define three variables: name, age, and one may judge that he is a new patient or an existing patient

Solution:
full_name = 'John Smith'
age = 20
is_new = True
Released six original articles · won praise 3 · Views 570

Guess you like

Origin blog.csdn.net/m0_46299010/article/details/104338402