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.
Sur cette page du site, vous pouvez voir la vidéo en ligne Variables , Data Types, Casting in Python by coding xpertz durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Coding Xpertz 18 février 2023, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 27 fois et il a aimé 0 téléspectateurs. Bon visionnage!