2) low level language known as (machin language, assembly language )
3) high level language take more time than low level language
4) all program are in high level language , specialized will be low level
5) interpreter read high level and compiler translate to low level language
6) translated by the compiler known as object code or executable
7) IDE (integrated development program called idle
8) .py extension used to execute in pythons
9) found by Guido van rorsun in late eighteen and early 90's in Netherland
10) easytolearn :- it have few keyword , clearly defined syntax
11) easy to read :- easy to maintain
12) GUI supports
13) interactive interpreter
14) debugging (syntax error, runtime error,symmantic error)
15) symmantic error (compile) but (not showing obvious output)
16) finding of symmantic error can be tricky
17) rich , challenging and interesting part of programming
18) formal language is used for mathematician used and in programming language
19) to make ordered dictionary use " from collection ordered dict "
20) 1 is integer and ' hello world ' is string identify string ( because its always in quotation)
21) if we put number in quotation marks will show string type
22) variable (a) = 17 [the variable a assign value as 17]
23) 27=n (its wrong structure)
24) a=7 print (a) >>>7 , type(a) >>>integer (because a=7 and value of variable is integer)
25) keyword cannot be variable like:-
And , del , from , not , while , as , elif , global , or , with , assert , else , if , pass , class , exec , in vaise , continue , finally , is , return , def , for , lambda , try
26) the value of the operator is operands
27) expression is a combination of value , variable and operator
28) script mod -> program can be modify and can be save interactive mode -> program gives instant output
29) in if statement data is compared
3) high level language take more time than low level language
4) all program are in high level language , specialized will be low level
5) interpreter read high level and compiler translate to low level language
6) translated by the compiler known as object code or executable
7) IDE (integrated development program called idle
8) .py extension used to execute in pythons
9) found by Guido van rorsun in late eighteen and early 90's in Netherland
10) easytolearn :- it have few keyword , clearly defined syntax
11) easy to read :- easy to maintain
12) GUI supports
13) interactive interpreter
14) debugging (syntax error, runtime error,symmantic error)
15) symmantic error (compile) but (not showing obvious output)
16) finding of symmantic error can be tricky
17) rich , challenging and interesting part of programming
18) formal language is used for mathematician used and in programming language
19) to make ordered dictionary use " from collection ordered dict "
20) 1 is integer and ' hello world ' is string identify string ( because its always in quotation)
21) if we put number in quotation marks will show string type
22) variable (a) = 17 [the variable a assign value as 17]
23) 27=n (its wrong structure)
24) a=7 print (a) >>>7 , type(a) >>>integer (because a=7 and value of variable is integer)
25) keyword cannot be variable like:-
And , del , from , not , while , as , elif , global , or , with , assert , else , if , pass , class , exec , in vaise , continue , finally , is , return , def , for , lambda , try
26) the value of the operator is operands
27) expression is a combination of value , variable and operator
28) script mod -> program can be modify and can be save interactive mode -> program gives instant output
29) in if statement data is compared
Flow diagram :-
30) nested of if statement:- elif to make another condition between if and else.
31) loop continues until we reach the last item in the sequence
31) loop continues until we reach the last item in the sequence
32) e.g. :- for loop with logic
33) number = [6,5,3,8,4,2,5,4,11]
Sum= 0
For val in number:
Sum = sum +val
Print ("the sum is : ",sum)
33) number = [6,5,3,8,4,2,5,4,11]
Sum= 0
For val in number:
Sum = sum +val
Print ("the sum is : ",sum)
34) while loop in python is used to repeat over a block of code as expression is true
35) while (variable here) text_expression:-
36) while loop run when condition is true and this code will run until condition will false
Diagram below :-
35) while (variable here) text_expression:-
36) while loop run when condition is true and this code will run until condition will false
Diagram below :-
37) n=10
Sum = 0
I=0
While I<n
Sum=sum + 1
I=I+1† #update counter
Print (" the sum I'd : ",sum)
Sum = 0
I=0
While I<n
Sum=sum + 1
I=I+1† #update counter
Print (" the sum I'd : ",sum)
Print (" the sum is : ",sum)
38)nested loop (break):-
Break is another loop in one loop and break will terminate the innermost loop. Its break the rest information
Break is another loop in one loop and break will terminate the innermost loop. Its break the rest information
39) code inside and outside of for loop :-
For variable in sequence:
#code inside of the loop
For variable in sequence:
#code inside of the loop
#code outside of for loop
40) e.g. of break loop statement
For val in " thing":
If val =="I":
Break
Print(val)
For val in " thing":
If val =="I":
Break
Print(val)
Print("the end")
Output:-
s
t
r
the end
41) the continue statement :-
It is used to skip rest of the code
s
t
r
the end
41) the continue statement :-
It is used to skip rest of the code
42) where break stop the loop here continue skip rest of loop's code if it got to the true
43) continue code
For val in "string":
If cal==" I"
Continue
Print(val)
For val in "string":
If cal==" I"
Continue
Print(val)
Output:-s
t
r
i
n
g
t
r
i
n
g
44)left hand side must be variable name not any assignment operator
45)Len only count the (str) string which is character
46)float convert to into but str count if float to int happen only before (.) Part will be shows
45)Len only count the (str) string which is character
46)float convert to into but str count if float to int happen only before (.) Part will be shows
47)true is predefined value but true is not (case matters)
48) abs(x) - the absolute value of x and the positive 0 to x
Ceil(x) - the ceiling of x the smallest integer integer not less than x
Cmp(x,y) - (-1 if x<y) (0 if x==y) (1 if x>y)
Exp(x) - the exponential of x:e^x
Fabs(x) - the absolute value of x
Floor(x) - the largest integer of x not larger than x
Log(x) - the natural logarithm of x for x>0
Log10(x) - the base 10 logarithm of x
Max(x1,x2.....) - largest argument : value closest to positive infinity
Min(x1,x2....) - smallest argument : value closest to positive infinity
Modf(x) - the integer part is returned as a float
Pow(x,y) - the value of x**y
Round(x[,n]) - x rounded to n digit from the decimal point python round away
Ceil(x) - the ceiling of x the smallest integer integer not less than x
Cmp(x,y) - (-1 if x<y) (0 if x==y) (1 if x>y)
Exp(x) - the exponential of x:e^x
Fabs(x) - the absolute value of x
Floor(x) - the largest integer of x not larger than x
Log(x) - the natural logarithm of x for x>0
Log10(x) - the base 10 logarithm of x
Max(x1,x2.....) - largest argument : value closest to positive infinity
Min(x1,x2....) - smallest argument : value closest to positive infinity
Modf(x) - the integer part is returned as a float
Pow(x,y) - the value of x**y
Round(x[,n]) - x rounded to n digit from the decimal point python round away
49) abs =positive (absolute value)
Print("abs(-45):",abs(-45))
Print("abs(-45):",abs(-45))
Output :-
Abs(-45):45
Abs(-45):45
50)math.Ceil(integer.remain(float))here
Math.pi = 4
51)math.exp(int.remaining)
Math.pi = 23.140692632779267
Math.pi = 4
51)math.exp(int.remaining)
Math.pi = 23.140692632779267
Output value will so long even after the decimal point like the math.pi value
52) abs ( ) and Fabs ( )is same function but abs is built in and fbs need to import
Import.math # import
Math.Fabs(x) # function call
Import.math # import
Math.Fabs(x) # function call
Print("math.fabs(-45.17):",math.fabs(-45.17))
Print("math.fabs(math.pi):",math.fabs(math.pi))
Print("math.fabs(math.pi):",math.fabs(math.pi))
Output:-
53) math.floor( ) return the largest integer but not greater than x
Print ("math.floor(-45.17):" math.floor(-45.17))
Print("math.pi",math.floor(math.pi))
Print ("math.floor(-45.17):" math.floor(-45.17))
Print("math.pi",math.floor(math.pi))
Output:-
Math.floor(-45.17): -46
Math.pi: 3
Math.floor(-45.17): -46
Math.pi: 3
54) math.logreturn natural logarithm
55) print("(100.12) of math.log : " , math.log(100.12))
Print("math.pi : ",math.log (math.pi))
55) print("(100.12) of math.log : " , math.log(100.12))
Print("math.pi : ",math.log (math.pi))
Output: -
(100.12) of math.log : 4.6063694665635735
Math.pi : 1.1447298858494002
(100.12) of math.log : 4.6063694665635735
Math.pi : 1.1447298858494002
Comments
Post a Comment