Skip to main content

Posts

Showing posts from September, 2017

Python #12-Recursion functions in Python

Previous post:                                                                                                                                     Next post: Python #11-Functions in Python                            Python #13-Let's Play with Python part-1-Fibonacci Series What is recursive function? A recursive function is a function which is called by itself.. Example: def decreasingorder(num):   if num==0:      print "values is Zero"   else:      print num      decreasingorder(num-1) decreasingorder(2)  ...

Python #11-Functions in Python

Previous post:                                                                                                                                     Next Post: Python #10-Dictionaries in Python                               Python #12-Recursion functions in python what are functions? functions are the set of programs instructions that perform a specific task. Syntax:     def functionName(arguments):            statements Note Worthy: def is the keyword in python which is used to define a function in python. Example:    ...

Python #10-Dictionaries in Python

Previous post:                                                                                                                                      Next Post: Python #9-Set Operation in Python                                                                          Python #11- Functions in Python What are Dictionaries in Python? Dictionaries is an unordered collection  of  key value pairs. How the dictionaries will look? A dictionaries hold the key and ...

Python #9-Set Operations in Python

Previous Post:                                                                                                                                     Next Post: Python #8-Sets in Python                                                                              Python #10-Dictionaries in Python What are set operations ? Set operations is defined as  performing operation with two data sets for finding  comparing, intersections of the elements . Set oper...

Python #8-Sets in Python

previous...                                                                                                                                              next....           Python #7-Class and Objects in Python                                 Python #9-Set Operations in Python What are sets in python? A set is an unordered collection with no duplicate elements. How to create set?  Use { , , ,  } - To create a set Syntax:     SetVariableName = {SetValues1, SetValues2, ..... } Example: ...

Python #7-Class and Objects in Python

cont....          of Python #6- Keyword in Python What is Class ? A class is a collections of objects. It is also called as grouping of data and functions. Syntax:    class className():        def methodName1(self):             statement        def methodaName(self):              statement Example:  Explanation:     As we know Python follows indentation. The spacing for the lines should be strictly followed to avoid any errors. #line 1:  It consists of the class name cname(): #line 2: def add(self):                This line allows you to create a function or method in python. Note Worthy: "self" is built in parameter constant which takes its own parameters if does not any parameters or arguments are supplied. #line 3: It is the normal print statement w...

Python #6-Keywords in Python

cont....           of Python #5 - Variables and Strings in Python What are Keywords? Keywords are the reserved for special purpose. It can't be used as variables name or identifiers. Keywords in Python: False          class           finally          is          return          None          for continue    lambda      try               True      def               from          while nonlocal    and             del              global   not               with           as elif           ...

Python #5-Variables and Strings In Python

cont....       of    Python#4-If and elif Statements in Python What are variables? A variable is the one which holds the values. Syntax :     VariableName = values Example:     variable = 1     print variable Output:     1 Integer Variable can be used like this in python...eg: variable =1 Note Worthy: Like C, C++, Java you don't have to declare the data type of the variable in python. The variable in Python is itself acts as datatype based on the values it holds.  How to store the Strings in variables? Its the same as the Integer Variable usage, but the minor change is .... The String should be surrounded with quotes .. Syntax:     StringVariableName = "String values goes here" Example:     String="Dharani"    print String Output:     Dharani Note Worthy: Some times you might get a doubt that...whether we should ' '  or " " for string ....

Python #4-If and elif statements In Python

cont.....          of   Python #3-For Loop and While Loop In Python What is if Statement? An if statement is Selection statement. It is also called as Decision Making Statement. Syntax:       if (condition):          statement Example:      marks = 39      if marks < 40 :         print "failed" Output:      failed Note Worthy: As i said previously Python uses indentation to make code blocks. So the statement should me done as it is in the above syntax. _________________________________________________________________________________ Don't forget to try here! ____________________________________________________________________________ if else: Syntax:       if (condition):          statement      else:         ...

Python #3-For Loop and While Loop In Python

cont.....          Of  Python #2-Tuples and List In Python what is For Loop ?  A statement which makes the code to executed repeatedly. Unlike in C,  C++, Java  For looping has the same syntax, but in Python its Different. Syntax:     for TemporaryVariableName in ActualVariableName :           statement Example:     values=['value1', 'value2', 'value3']         for value in values:        print value  Ouput:    Value1    Value2    Valus3 Note Worthy: for statement should have : at the end of the line in python          eg:  for(condition):   _____________________________________________________________ Don't forget to Try it! _____________________________________________________________ What is while Loop? A statement which makes the cod...

Python #2-Tuples and List In Python

cont......          Of Python #1- A way to start with Python what is Tuples ?  A tuples is sequence of elements .Immutable ordered Sequence. What is Immutable? You can not able to change the values once its is declared or Initialized . Syntax:     TupleVariableName = somevalues1, somevalues2,... Note Worthy : A comma is Tuple create Operator in Python. Example :     TuplesVariableName = 1, 2, 3     print (TuplesVariableName) Output:     (1, 2 ,3) To find the Length of the Tuple? Syntax:     len ( TuplesVariableName )                   #len is the keyword to find the Length Example:    print  len ( TuplesVarableName ) Output:     3 _________________________________________________________________________________ *In case if you want to print the particular tuple values Syntax:     Tuple...

Python #1-A way to start Python

Hai , Here is my blog which i learn from the google i used to post in this space.. so there might be some contents will taken from other source too as a part of learning. The learn will be made Easy here. If you like and Need to learn like this more.. Do Follow...#Tech Bird Lets Start with Python.! Example 1:  How to Write "Hello World !" in python  It is much simpler than other programming languages.Yup! Syntax:          print "Statement" Example:         print "Hello World!" Output:        Hello World Note Worthy: In python there is no need to place a ; once the statement is ended. Example 2: How to add two numbers in Python. Its is as such as simple maths problem..Yup! Example:     a=10     b=10     c     c=a+b     print "c values is: "+c Output:     c values is : 20 Note Worthy: In python you don't have ...

How to use command line arugments in c

Hi its me Dharani again with a blog ... About : " how to use command line arugments in c" Requirements : " Gcc compiler installed and Cmd(command prompt)" ****I will be using SublimeText3 for coding no worries you do those stuff with notepad itself***** Note: Gcc is used to compile the program bcz cmd does not know any programming languages.. Cmd acts as console to compile and run the program ... Cool..! Lets get Started.. Hoping Gcc has been installed on your system. First you need a Piece of code to start with.. //MyFirstProgram.----C program to print all arguments given through command line. Source code: #include<stdio.h> void main(int argc, char const *argv[]) { /* code */ int a,b,c;     printf("Enter the Three Values:"); scanf("%d %d %d",&a,&b,&c); printf("Values in the arguments: \n a is %d b is %d c is %d", a,b,c); } Save this code in Notepad File and save as .. some...

Getting Started with Python

Python  Python is an object-oriented programming language created by Guido Rossum in 1989.  It is ideally designed for rapid prototyping of complex applications.  It has interfaces to many OS system calls and libraries and is extensible to C or C++.  Many large companies use the Python programming language include NASA, Google, YouTube, BitTorrent, etc. Python had deep focus on code readability .. Advantages: Extensive Support Libraries Integration Feature Improved Programmer’s Productivity Productivity Python used in Artificial Intelligence,  Natural Language Generation,  Neural Networks and other advanced fields of Computer Science. Simple Program using Python. Example: print "hello world!" Output: hello world Thank You👍😍! Come Back to Learn More From Tech  Bird 😜✌👻😍