Python is Open source, Interpreted, object oriented, high level language
Influenced bu ABC and basic language.
an interpreted language is a type of programming language where the source code is not compiled into machine code before the program is run. Instead, the source code is directly executed by an interpreter, which is a program that reads and executes the code line by line.
The interpreter translates each line of code into machine language, or another form of executable code, and then immediately executes it. This process continues until the end of the program is reached or an error occurs.
Interpreted languages are often used for scripting and prototyping, as they typically have a shorter development cycle than compiled languages. They are also often more flexible, as changes to the code can be made and tested more quickly. Some examples of interpreted languages include Python, Ruby, JavaScript, and PHP.
- Easy to use
- Expressive
- Interpreted (Line by line code compilation)
- Platform Independent
- Free & open source
- Robust (Python is considered a robust language due to its strong emphasis on code readability, simplicity, and ease of use. ) Easy to learn and use: Python's syntax is straightforward and easy to read, making it a popular choice for beginners and experts alike.
Large standard library: Python comes with a vast collection of pre-built modules and libraries that make it easy to perform a wide range of tasks.
Dynamic typing: Python is dynamically typed, which means that variables are not required to be declared with a specific data type. This makes it more flexible and allows for faster development.
Automatic memory management: Python uses garbage collection to automatically manage memory, freeing developers from having to worry about manual memory management.
Cross-platform compatibility: Python can run on multiple platforms, including Windows, Linux, and macOS, which makes it highly portable and adaptable to different environments.
Active community support: Python has a large and active community of developers who contribute to its development, ensuring that bugs are quickly fixed and the language stays up to date with the latest technology trends.
These features, among others, contribute to Python's reputation as a robust and reliable language.
- Rich library support
A valid set of char that lang can recognize
- Letters A-Z,a,z
- Digits 0-9
- Special symbols
- Whitespaces
Smallest indiividual unit in program is a token / lexical unit
-
Keywords => (Are the words that convey a special meaning to compiler/interpreter)
-
Identifiers => (Name given to variables,Functions,lists,dictionaries,classes,objects)
-
Literals =ฬ> (Data iterms that have fixed value String,Numeric,Boolean,None(Special Literal))
-
Operators => (Trigger some computation)
-
Punctuators => (Punctuators are symbols used in programing language to organize sentence structures)
-
Single line #
-
Multi line => ''' '''
-
A variable in python represents names location
-
variables are not storage containers in Python
-
Dataspace memory has literal at defines mem loc and each mem loc has mem address
- tells us datatype of variable type(varable name)
- Variable pointing to value of certain tyope, can be made to point a value / obj of different type.
-
input() => to get unput from user
-
return type of input is string
-
we can use int(), float() with input. to convert values from input to int and float.
-
Print() gives output
-
print automatically converts output to strings
-
inserts space between items automatically
- seperates output with provided keyword
- print("hello","world",sep=',') hello,world
- print("hello",end=',')
- print("world")
- print appends newlie char unless end is specified