First step Towards Programming | First step Towards Programming for Python | beginner Level | Session_3
Python as a calculator
you go to open python IDE First Window Open python shell Mode you can type your code that Shell you got a quick answer following steps guide you how to do! Let's get started.
Number:
you open a python shell Mode then type following Simple steps, Python has different data types handle numbers we discussing the data structure of python on the next session.
Example
>>2*2
>>50*5*6
>>(50-5*6)
>>8/5
*you type the following questions in your shell mode share the answers in comment window students.
Example
Example
>>2*2
>>50*5*6
>>(50-5*6)
>>8/5
*you type the following questions in your shell mode share the answers in comment window students.
String
String defines as to identify user what? was that in a particular script, for example, you write code for student monitoring system programming using python what you mention the program you give student name and student class and section much more info add in the script but one thing you know understood string doesn't execute during debug time not only python all programming Language common in This rules also main information of Sting.
Python String notated in the double quotes(" ") or single quotes(' ')
Examples of String in Python
>>'Hello TechTrainer.site' #Single Quotes
Hello TechTrainer.site
>>"Hello TechTrainer.site" #Double Quotes
Hello TechTrainer.site
List
You know previously any one of the programming languages like C,C++, JAVA most of the Languages have definitely Contain Array concepts but python optimizes and beat all of the programming languages Python has different concepts to handle an array.
The list is similar to array concepts list notated open and close Square Bracket below examples clear, your doubts what is List
Example for List :
>>squares=[1,2,3,4,5,6,7]
>>squares
[1,2,3,4,5,6,7]
Python Script First Step towards programming
Another Special concept about python must you know python have no need Compiler Notaions like don't need to write a Compiler termination Simples, for example, you write c and c++ programming you should write must compiler termination special characters like semi-colon(;) colon and much more than the only program execute correctly else definitely your program not working python no need this execute code directly without the semicolon and colon simples end of the coding.
Example of Python Script
>>a,b = 0,1
>>while b<10
print(a,b)
A,b = b,a+b
>>
0...9
Python Keywords
Python is scripting Language Ok so you need must Know keywords about python following some important keywords given below.
These keywords Mostly Helping you due to programming, must Learn this keyword helping you Lot next we move on another topic.
Indentation
Indentation is nothing this is a block of code python generally allows you Whitespace as intent and python also allows you preferred tab.
Example:TechTrainer.py
For i in range(0,100)
print(i) #This Line Started after Four Whitespaces
if i == 50:
print(i) #This Line Started after Four Whitespaces
Comments
Comments helping you another developer helping you understand your coding right way. python has two different commands there called single-line comments and multi-line comments
single-line comments using # and then multiline comments using "" you just listing the example of those given below
Example
a=10 #a variable assing as 10
"This is also www.techtrainer.site"
0 comments: