You are on page 1of 2

NOTES OF PYTHON

1. FUNCTIONS AND VARIABLES


EXTENSION- .PY

FUNCTION
A function is an action or a verb that lets you do something in the program. Every language comes
with some predetermined functions.

print() use to get the output at the terminal

input() use to get input from the user

ARGUMENTS
An argument is an input to a function to a function that somehow influences its behavior.

BUGS
A bug is a mistake in a program and it can take many forms.

VARIABLES
A variable can store a value(it could be a number, some text, even an image or video or more). A
variable is just a container for some value inside a computer or a program.

Ex

Name, a, d, added

COMMENTS(it is a pseudocode)
Comments are notes to yourself in your code.

We include comments by a special symbol -in Python ------ #

DEFAULT PRINT FORMATE IN PYTHON FUNDAMENTALS


print(*object, sep=” ”,end=’\n’)

DATA TYPES
Data types are categories of values that determine the type of operations that can be
performed on them. In programming, data types help in defining the variables and functions
that are used in the code. Some common data types include integers, floats, strings, and
booleans.
1. String---- str
2. Integer---- int
3. Float-----float

KEYWORDS
def ------ it is used to create a function

or ---------it used to give multiple conditional statements, where if any condition is true then the
output will be true or otherwise false.

And------it is used to give multiple conditional statements, where all conditions should be true to get
the output as true or otherwise false.

CONDITIONALS

if
It is a conditional statement used to check a condition and execute it if the condition holds
true otherwise proceed further in the code. It is also a control flow statement, which utilizes
decision-making to control the flow of execution.

elif
In Python, elif is short for "else if" and is used when the first if statement isn't true, but you
want to check if another condition can be satisfied or not.

else
The else keyword is used in conditional statements (if statements), and
decides what to do if the condition is False.

You might also like