Monday, January 19, 2015

Python Class 105 - Kapil Sharma

Python Information Cheat Sheet:

1) python –V   or  python –version  #This shows the current installed python version.

2) pip freeze will output a list of installed packages and their versions.

3) pip install django  #This will install django framework.
 pip install django –upgrade #For Django upgrade.

4) Literal Constants - An example of a literal constant is a number like 5, 1.23, 9.25e-3 or a string like 'This is a string' or "It's a string!". It is called a literal because it is literal - you use its value literally.

5) Numbers - In Python are of four types - integers, long integers, floating point and complex numbers.

6) Strings - A string is a sequence of characters. Strings are basically just a bunch of words.

7) Variables - Their value can vary i.e. you can store anything using a variable. 

8) Identifier Naming - Variables are examples of identifiers. Identifiers are names given to identify something.

9) Data Types - Variables can hold values of different types called data types. The basic types are numbers and strings.

10) Objects - Python refers to anything used in a program as an object. 

11) Logical and Physical Lines - A physical line is what you see when you write the program. A logical line is what Python sees as a single statement. Python implicitly assumes that each physical line corresponds to a logical line.

12) Indentation - Actually, whitespace at the beginning of the line is important. This is called indentation. Use a single tab.

13) Operators - Operators are functionality that do something and can be represented by symbols.

14) Operator Precedence – PMDAS order by which math operation executed.

15) The if statement - The if statement is used to check a condition and if the condition is true, we run a block of statements (called the if-block), else we process another block of statements (called the else-block). The else clause is optional.

16) The while statement - The while statement allows you to repeatedly execute a block of statements as long as a condition is true. A while statement is an example of what is called a looping statement. A while statement can have an optional else clause. 

17) The for loop - The for..in statement is another looping statement which iterates over a sequence of objects i.e. go through each item in a sequence. 

18) The break statement - The break statement is used to break out of a loop statement i.e. stop the execution of a looping statement, even if the loop condition has not become False or the sequence of items has been completely iterated over. An important note is that if you break out of a for or while loop, any corresponding loop else block is not executed.

19) The continue statement - The continue statement is used to tell Python to skip the rest of the statements in the current loop block and to continue to the next iteration of the loop.

GitHub: 
https://github.com/bornfreesoul/Python/blob/master/BasicOne

Tuesday, December 9, 2014

Python Class 104 - Kapil Sharma

Python CBT on YouTube:



Python Class 103 - Kapil Sharma

Function Creation:

>>> def functionName1():>>> print("Kapil")
>>>
>>> functionName1()
>>> Kapil

To create a python function 'def' word needs to be pre-fix in front of user function name end by"():"

OR

Users can also create functions like this way:

>>> def functionName2(Message):
>>> print(Message)
>>> functionName2("This is my message!")
>>> This is my message!

OR

>>> def functionName3(Message = "My Message."):
>>> print(Message)
>>> functionName3()
>>> My message.

OR

>>> def addVal1(Val1, Val2):
>>> print(Val1, "+" Val2, "=",(Va1 + Val2))
>>> addVal1(3,2) #User add the value 3,2
>>> 5  #Python IDE result is 5

OR

>>> def addVal2(Val1, Val2):
>>> return Val1 + Val2
>>> print("2 + 3 equals to 4 + 1 is ", (addVal2(2,3) == addVal2(4,1)))
>>> 2 + 3 equals to 4 + 1 is True #Python IDE result is 5 equal 5 True.


Monday, December 8, 2014

Python Class 102 - Kapil Sharma

Number Types In Python: 

Integers: They are whole/natural numbers with +/- number range.
                e.g: -3,-2,-1,0,1,2,3

Floating Values: Numbers with decimal values. 
                          e.g: 7.77

Complex Values: Real numbers + Imaginary numbers. 
                            e.g: 7 + 7XY 

Boolean Values: 0 OR 1 #True OR False

Note: To find type of any number: 

>>> myValue = 5 #User enter a variable value.
>>> type(myValue) #Than user search for variable type.
>>> #Python shows that user value is integer.






Operators In Python: 

Unary (+,-,~)
Arithmetic (+,-,*,/,%,//,**)
Relational (==,!=,>,<,>=,<=)
Logical (and, not, or)
Bitwise (&,|,^,~,<<,>>)
Assignment (=,+=,-=,*=,/=,%=,**=,//=)
Membership (In, not in)

Identity (Is, is not)

Python Class 101 - Kapil Sharma

Python Help Cmds: 

Start the python cmd window and type the following cmds for help information.

>>> help( )
>>> modules 
OR 
>>> types 
OR
>>> keywords
OR
>>> functions
OR
>>>help('FUNCTIONS')

Note: To exit help mode press "Ctrl + C".









Friday, April 25, 2014

ASP.Net: Class 1001

From where and how to start ASP.Net and C# code learning?

In  most of the programming training the pre-requisite of learning new language is like they assume that you have some basic coding knowledge like c or c++ or vb. 

But here even if you have or have not, its ok :) 

Will learn and share and do C# ASP.net coding and creating web site and application. 
Only thing is that you should committed to learn and comment out your learning and issue experiences, so that any new fellow get inspired and learn from your genuine experience. 

So, let's start the coding :) 

For this we need IDE and the good thing is that Microsoft already made a IDE for us. 

Click on the following link: 

1) http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx 


Select this IDE edition: Express 2013 for Web. 
Note: Its best that windows O.S 7 or 8 machine with 3+ GB RAM and 150 GB HDD drive space, to run IDE in fast and workable mode.  (No, Linux or Mac for this tool.)


Monday, February 24, 2014

Hacking Raspberrypi .

Raspberrypi Hacking: 

FM Transmitter to radio frequencies. 

DIY by transmit sound by using PiFM.  

http://www.raspberrypi.org/


Blockchain: 101 (By - Kapil Sharma)

 https://testing-mines.blogspot.com/2021/10/blockchain-101-by-kapil-sharma.html Blockchain through the following attributes: Distributed:  T...