Python

Functions of Strings in Python

Strings: Any combination of characters or text written in single, double, or triple quotes are treated as strings. Internally strings are stored in single quotes. Example: #string of lowercase and uppercase alphabetsstring1=”Gargs Academy” #string of alphanumeric characters ie alphabets and digits string2=”Phone no 9467863365″ #empty Stringstring3=”” Creating Strings by directly assigning string literals: We can …

Functions of Strings in Python Read More »

Comments in Python

Comments: These are the statements that are ignored by the python interpreter and not executed at all. Why Comments are used:1) To explain the program2) To make the program more understandable3) To prevent the statements from execution for testing purpose. Types of Comments in Python: 1) Single Line Comment2) Multi LIne Comment Single Line Comment: …

Comments in Python Read More »

Variables in Python

Variable : It is a symbolic name that is a reference or pointer to an object. Once an object is assigned to a variable, you can refer to the object by that name. Example: a=5b=10.78c=2 + 7jd=”Gargs Academy”e=Truef=Nonea,b,c,d,e,f are variables of different types. We can assign any type of value to a variable in python. …

Variables in Python Read More »

Functions of tuples in Python

Tuples: Tuples are used to store multiple items (may be of same type elements ie homogeneous data types or different types elements ie heterogeneous data types) in a single variable. It is a comma separated list of values enclosed in paranthesis ( ). Example: tuple1=(2,3,4,5) #tuple of homogeneous elements tuple2=(“gargs”, 100, 24.56 ) #tuple of …

Functions of tuples in Python Read More »

Functions of lists in Python

Lists: Lists are used to store multiple items (may be of same type elements ie homogeneous data types or different types elements ie heterogeneous data types) in a single variable. It is a comma separated list of values enclosed in square brackets [ ]. Example: list1=[2,3,4,5] #list of homogeneous elements list2=[“gargs”, 100, 24.56 ] #list …

Functions of lists in Python Read More »

Introduction to Python

Python Features of Python: Interactive mode is where you type commands and they are immediately executed. Example: >>> print(“Welecome to Python @Gargs Academy”) Welecome to Python @Gargs Academy Script mode is where you put a group of commands into a file (a script), save it with any name (.py extension) and then Run Program to run …

Introduction to Python Read More »

Tokens in Python 3.9

Tokens: A token is the smallest individual unit in a python program. There are 5 types of tokens in Python: Keywords: These are reserved words in python used for some specific purpose. They cant be used as variable names, function names, or any other general purpose. There are 36 keywords in Python 3.9 How to …

Tokens in Python 3.9 Read More »

error: You can only copy the programs code and output from this website. You are not allowed to copy anything else.