


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Python Notes(Class 7) Python is one of the most popular programming languages used by people world over.It is a high-level computer programming language .This programming language enables you to create interesting programs that can be used to do things faster and better.This is similar to English language. Guido Van Rossum developed python in 1991 at the national Research Institute for mathematics and computer science in Netherlands. Python 3.0 was released on 3rd^ December 2008. FEATURES OF PYTHON 1.EASY TO LEARN: It is easy to learn programming language,since it has fewer keywords and uses simple English words. 2.Plateform Independent:The programs written in python can run on different hardware and software plateforms.Program written in LINUX operating System can be executed in on a machine with different operating System. 3.FREE AND OPEN SOURCE: Which means it can download without paying. 4.HIGH LEVEL LANGUAGE: An English like language. 5.INTERPRETED LANGUAGE: Programs written in python are executed by an interpreter(lne by line). 6.EXTENSIVE LIBRARY SUPPORT: Python has an extensive inbuilt library which is openlyavailable for every user.It helps saving your time and efforts. USES: It can be used to built website,program a robot,develop Artifificial intelligence Application,create virtual games,perform scientific computation etc.s Modes in python IDLE stands for integrated Development Environment. Python interpreter offers the two basic modes to enter command. Interactive mode & script mode. 1.Interactive mode: In this mode, commands are executed line by line. In this mode codes are typed directly in the shell window and ouput is also displayed in this window. 2.Script mode: It is used for long program that contain multiple python statements.In this mode , you can store statements in file in order to use them later. Keywords: It refers to the reserved words that have specific/predefined meaning to the python interpreter. Variables: It is a place to store values in computer memories. A variable can hold a single value. **Rules to declare a variable Name *** A variable name must be begin with a letter(uppercase or lowercase) or an underscore.
int: int or integer stores positive or negative numeric values.Integer represents integral numbers,which are the numbers without decimal point.e.g. x=89,y=- 25 float : float or floating point number could be a positive or a negative numeric values with a decimal point e.g x=6.6,y=8. String: String data type refers to set of characters,which are enclosed within single code(‘ ‘) or a double quotes(“ “) INPUT () FUNCTION: In a python program, the input () function is used to take a value(input) from the user And assign it to a variable. To accept numeric values: To input integer and float values, you can use int() and float() along with input() function,respectively. age=int(input(“enter age”))------------------used to take integer value from the user percentage=float(input(“enter percentage”))---------------used to take float value from the user To accept text values: a=input(“enter your hobby”) PRINT () FUNCTION EXAM.print(“PYTHON IS AN INTRESTING PROGRAMMING LANGUAGE”) Print(A,B,C) Print(A,”\t”,B,”\t”,c)------t used for tab space Using new line character(\n): print(A,”\n”,B,”\n”,C) OPERATORS: Are special symbols that are used to perform arithmetic and logical operations on variables and values, and provide a meaningful result. Types Of Operators: Arithmetic Operators: Are used to perform basic mathematical calculations. Exam: + addition
elif ch == '-': result = num1 - num elif ch == '*': result = num1 * num elif ch == '/': result = num1 / num else: print("Input character is not recognized!") print(num1, ch , num2, ":", result)