
It's is a high-level programming language.
It is easier for beginners to read and grasp.
Furthermore, being general-purpose programming language, Python is quite versatile for different sorts of projects.
Python is administered by the non-profit Python Software Foundation.
Python programming language's founder is Guido van Rossum.
-----------------------------
Console (also called Shell) is basically a command line interpreter that takes input from the user i.e one command at a time and interprets it. ... The Python Console accepts command in Python which you write after the prompt.
to save Python pgm,
How do you save a python program?
Go to File and click on Save as.
In the field Save in browse for the C: drive and then select the folder PythonPrograms.
For the field File name remove everything that is there and type in Hello.py.
In the field Save as type select All Files.
Click on Save. You have just created your first Python program.
Introduction to the IDLE interpreter (shell) and its documentation.
In the last tutorial, we had studied how to start Python and about the version of Python which we are using and from where to find it out as well.
Python Shell waits for the input command from the user. As soon as the user enters the command, it executes it and displays the result. To open the Python Shell on Windows, open the command prompt, write python and press enter. As we saw, a Python Prompt comprising of three Greater Than symbols (>>>) appears.
To access the Python shell, open the terminal of the operating system and then type "python". Press the enter key and the Python shell will appear. for this, we understood that how to give the path for Python in environment variables and system variables.
Even we saw how to create a new file to write down the code and how and where to save it.
Understanding variables.
Comparison of giving values to variable in mathematics with a programming language.
understanding the datatype of variable
printing the value of variable mentioned
finally, understood how to add two variables and print the final value
By now, we know why Python is to be used..and how to start. right?
Later we studies what are variables how to assign values to them and later we understood to find type
Then we found how to add two numbers too.
now, we will see what is type(). this type is a built in function, which allows us to find the datatype. The meaning of datatype is whether the value entered is integer(marks or age) or float(with decimal pt) or character(like your name).
Print() is also a built in function which allows to print values
now we will see various operators like arithmetic operators first.
They are + , - , *, / , % and //
out of this % is known as mod
// is floor division. We tried them today.
Hi again, we will understand how to work with the relational and logical operators.
The relational operators always set up the relation between two variables at a time. They are >,<,>=,<=,== and !=.
Please keep it in mind the =(single equal to) is not at all a relational operator.
In the same manner there are logical operators and they are and, or and not
We will study them later
Hi again, we will understand how to work with the logical operators.
Like relational operators there are logical operators too and they are and, or and not.
When and is used when both the conditions are true
When or is used when either of the condition is true
and not is for none of then is true.
We'll try to understand boolean values in short also.
We have studied logical operators in this tutorial.
Simple input-output and Sequence statement
In this tutorial we will learn to write or code simple programs using input and output statements.
We will go through some simple codes and would learn to write code.
Writing simple programs in Python for example to write a program to calculate the area of circle and to calculate simple interest etc.
Hello all, we know about the arithmetic operators, right?
Do you remember we had learnt +,-,*,/,%(mod) and //(floor division)
Operator Description
() Parenthesis
** exponentiation(raise to power)
*, /, %,// Multiplication, division, remainder,floor division
+, - Addition, subtraction
--------------------------------------
Conditional statements
if ...else condition is the one which allows conditions to be written.
If conditions are basically written using relational operators and the logical operators.
Firstly, we will look into using relational operators.
a = 233
b = 500
if b > a:
print("b is greater than a")
In this example, we use two variables, a and b, which are used as part of the if statement to test whether b is greater than a. As a is 233, and b is 500, we know that 500 is greater than 233, and so we print to screen that "b is greater than a".
------------
Here we can see the : operator which is given after any condition(actually written after loop , functions, we will see many more syntax where auto-indentation is used) this is the peculiarity of this language where the: operator is used and it allows us to ident. Other programming lang like C, Java allows to use { ...}.
-----------------------------
Why Python? 1
Reasons for Python as the learner are the first programming language.
Introduction to the IDLE interpreter (shell) and its documentation.
Building Blocks of Program: Data, Data Types, Data Binding, Variables, Constants, Declaration, Operations on Data such as assignment, arithmetic, relational, logical operations, dry run, and variables used.
Develop Code using Python: Features, basic syntax, Writing and executing a simple program, Basic Data Types such as numbers, strings, etc.
Declaring variables, Performing assignments, arithmetic operations, Simple input-output Sequence Control:
Precedence of operators, Type conversion Conditional Statements: if, if-else, nested if-else.
Looping: for, while, nested loops Control statements: Terminating loops, skipping specific conditions
Collection Manipulation: declaring strings, string functions, Lists, Tuples.
Functions And Modules: Defining a function, calling a function, Advantages of functions, types of functions, function parameters, Formal parameters, Actual parameters, global and local variables,
GUI Programming in Python (using Tkinter/wxPython/Qt) What is GUI, Advantages of GUI, Introduction to GUI library. Layout management, events, and bindings, fonts, colors, drawing on canvas (line, oval, rectangle, etc.) Widgets: frame, label, button, check button, entry, Listbox, message, radio button, text, spinbox, etc.
Finally, the role of Python in ML and NLP.