Class 9 AI Notes Python
Class 9 AI Notes Python
Comments are the piece of code that is generally ignored by the Interpreter, it helps the
programmer to keep track of the code, organize it properly, and Maintain the code collectively in
a team
Variables in Programming act like containers that can store different types of data or any data
value in them, a variable in a python program gives data to the computer for processing.
How to Create Variables in Python?
In python, a variable can be created by just naming it and assigning some value to it, a variable is
created the moment you first assign a value to it.
x = "Your Name"
print(x)
What is a Datatype ?
In previous lessons, we stored data in variables. There, some text was in quotes and some were
not in quotes. As computer don’t know how to put something under a type of data.
For example, if you write text and number then You should tell the computer which one is text
and which integer
Data
To Change Denoted by
Type
String str() ”“
Integer int() None
dict(name =
Dictionary “somename”,work {“a”:”b”,”c”:”d”}
=”somework”)
What is PIP?
PIP is a package manager for Python packages, or modules if you like.
• Easy to learn: Python is easy to read and has a simple syntax. It's often written
using English keywords instead of punctuation, and doesn't use curly brackets to
delimit blocks.
o Error! Filename not specified.
o Error! Filename not specified.
• Open source: Python is free and open source.
o
• Supports multiple paradigms: Python supports multiple programming
paradigms.
The input functionIn Python, we request user input using the input()
function. Syntax message = input("This is where you type in your input
request: ") This set of code is requesting for user input, and will store it
in the message variable.
What is print statement in python
In Python, the print() function is used to print the desired message on
a device's screen.
What is python IDLE ?
Python IDLE (Integrated Development and Learning Environment) is an
integrated development environment for Python that comes bundled
with the standard Python distribution. It serves as a convenient tool
for writing, testing, and debugging Python code.