Posts

Showing posts with the label Variables

Python Tutorial 7---"Sets in Python"

 Python Tutorial 7--- "Sets in Python" This PROGRAM or TUTORIAL about Python's  "Sets in Python". DOC Let's start with the basic definition of sets in Mathematics. People already familiar with the concept of sets in mathematics know that as per the mathematical definition - A set is a collection of well-defined objects and non-repetitive elements that is - a set with 1,2,3,4,3,4,5,2, 2, and 3 as its elements can be written as {1,2,3,4,5} No repetition of elements is allowed in sets. In Python programming, sets are more or less the same. Let's look at the Python programming definition of sets: “A set is a data structure, having unordered, unique, and unindexed elements.” Elements in a set are also called entries and no two entries could be the same within a set. If your curiosity isn’t satisfied with the basic definition, do not worry as we are approaching a more formal illustrative approach to an understanding of python sets. Well, now that y...

Python Tutorial 3---"Variables, Datatypes and Typecasting "

  Python Tutorial 3--- "Variables, Datatypes and Typecasting " This PROGRAM or TUTORIAL about Python's   "Variables, Datatypes and Typecasting " DOC Variable: A variable is a name given to any storage area or memory location in a program. In simple words, we can say that a variable is a container that contains some information, and whenever we need that information, we use the name of that container to access it. Let's create a variable: a = 34 # Variable storing an integer b = 23.2 # Variable storing real number Here  a  and  b  are variables, and we can use  a  to access 34 and  b  to access 23.2. We can also overwrite the values in  a  and  b Data Types in Python: Primarily there are following data types in Python. Integers (<class 'int'>): Used to store integers Floating point numbers (<class 'float'>): Used to store decimal or floating-point numbers Strings (<class 'str'>): Used to store st...