The 1st thing to know is that all Python files end with the extension .py. Then you have to
understand that every programming language must have the ability to Accept, Store and Name
Data.
You have to be able to receive data from the keyboard, or from other parts of your program and
assign a name to that data. This data is either a single value or multiple values that are
assigned a name. Data that is assigned a name and that contains data is called a Variable.
Python has many different ways to store lists of data which I’ll cover later.
It is convenient to assign names to data. If I want to store my age in Python I’d type my_age =
43. If I wanted to store my name I’d type my_name = “Derek”.
Rules for Naming Variables
Your variables can start with a letter or _ (Underscore)
After the 1st letter you can use numbers such as num_1
You can’t put spaces in variable names my_age is ok, but my age is not
It is considered good practice to separate words with underscores (my_age vs. myAge)
Keywords that you can’t us for variable names
and, del, from, not, while, as, elif, global, or, with, assert, else, if, pass, yield, break,
except, import, print, class, exec, in, raise, continue, finally, is, return, def, for, lambda,
try
Try running this code where you assign your name to a variable and then print a message.
Auf dieser Seite können Sie das Online-Video Variables , Data Types, Casting in Python by coding xpertz mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Coding Xpertz 18 Februar 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 27 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!