Posts

Showing posts with the label Python

Data structure(Searching linear and binary)

Image
Linear sear ch :-इस Search सर्च में element को एक-एक करके search किया जाता है और जहां element  मिल जाता है search complete. (Compare element one by one) Time taking      Best Case = O(1)     Average Case = O (n)      Worst Case Complexity O(n) Assume Find K = 41  Program # Linear Search in Python def linearSearch (array, n, x) : # Going through array sequencially for i in range( 0 , n): if (array[i] == x): return i return -1 array = [ 2 , 4 , 0 , 1 , 9 ] x = 1 n = len(array) result = linearSearch(array, n, x) if (result == -1 ): print ( "Element not found" ) else : print ( "Element found at index: " , result) Binary seach :-( Worked with sorted Array ) हमारे पास elements (a+b/2)  को Check किया जाता है और उसके हिसाब से Half parts  को eleminate कर दिया जाता है और आगे के Parts  को ऐसे ही तरीके से सर्च किया जाता है. Program for Binary Search by iteration a...

Python (Syllabus)

 Python Syllabus UNIT - I  Planning the computer program: concept of problem solving, problem definition, program design, debugging, types of errors in programming, documentation. Techniques of problem solving: flowcharting , decision table, algorithms, structured programming concepts, programming methodologies viz. Top-down and bottom-up programming. Overview of programming: structure of a python program, elements of python.  UNIT - II  Introduction to python: python interpreter, using python as calculator, python shell, indentation. Atoms, identifiers and keywords, literals, strings, operators (arithmetic operator, relational operator, logical or Boolean operator, assignment, operator, ternary operator, bit wise operator, increment or decrement operator) Creating python programs: input and output statements, control statements(branching, looping, conditional statement, exit function, difference between break, continue and pass.), defining functions, default argume...

Python Syllabus

 Python Programming Basic Technique of Problem Solving: Flow Chart, Decision Table,  Algorithm Programming Approach Top Down, Bottom Up, Moduler   Python Introduction Python Comments Python Installation Python Variable Python Data Types Python List , String, Tuple, Set  Dictionary Python Keywords & atoms Python Literals , Keywords Python Operator If Else Loop - For , While Break & Continue & Pass Function ( find, Error & Exceptions Iteration and Recursion  Modules Two Dimensional Tables String -slices, String Comparison, Length  Loops Operation - accessing Element, length, membership. Object Oriented : Class - Objects, Method Standard Libraries. Data Structure : Array, list, set, Stacks, Queues. Searching and Sorting: Linear and binary Search, Bubble, Selection & Sorting.

Python Loop

 Loop : The execution of a specific code may need to repeated several number of times. 1. For Loop 2. While Loop    Program 1 N  = Int (Input (" Enter any no ") For i in range (1,11 ):          c = n*i          print ( N , "*", i , " = ", C) Program 2.  i = 1 While ( i < = 10 ):          Print ( i )         i = i +1   For  While

Python (conditional Statement)

 If Conditional Statement 1. if  2. if .. Else 3. nested Program:1 IF     Num = Int(input("Please enter any no"))     If num%2 = = 0 :             print ("Number is even ") Program 2 if ... else      Num = Int(input("Please enter any no"))     If num%2 = = 0 :             print ("Number is even ")     Else :               Print (" no is odd") Program 3     Num = Int(input("enter any No."))     if  Num = = 10 :          Print ("num is     Equal to 10 ")     elif Num = = 50:          Print ("No is equal to 10 ")     Else:          Print (" no. is not equal to 10 and 50 ) Refrence

Day - 6 Python (keywords & Operator)

(Keywords are special reserved words) True False None and as asset def class continue break else finally elif del except global for if from import raise try or return pass nonlocal in not is lambda Python Operator Arithmetic (+,-,*, %(remainder), ** exponent, // floor ) Comparison Operator (==, != , <= , <=,>,< Assignment Operator ( =, +=,-=, *= , %=, **= (power) ,//= (floor) Logical Operators  (and , or, not ) Bitwise Operator ( & (and) , |  (or) ,^ (xor), ~ (nor) , << (left Shift) , << (right shift) Membership Operator (in, not in ) Identity Operator ( is, is not)

Day -5 Python Datatypes

 Python Data types 1. Number     a. Integer ( 10, 2, 29, -20  )     b. Float ( 1.9, 9.902, 15.2)     c. Complex ( 2.0 + 2.3j) 2. Sequence     1. String ( "hello yunus sir" )     2. List ( ["yunus" , 877, 125] ) - use Square      3. Tuple ( ( "yunus" , 877, 125) ) - use Parentheses 3.Boolean 4. Set ( {"james",4,5} )- no dublicate entry 5.Dictionary ( {1:'yunus',2:'Digital'} )

day -4 python String

Image
 Strings Are Array (examples) 1.  2.      3. 4. 5. 

Day 3 Python variable (Hindi and english notes)

Image
 Variable :- Direct Assign value           Rules : -use only alphabets and _underscore in starting & it is case sensitive .           example:  x =  "John" , x =  'John' Casting : Specify the datatype of a variable           X = Str(3)  #it will show x contain integer Note important function - type(x)  output : <class 'int'> Cases :- Camel Case :  myVariableName =  "John"          Pascal Case :  MyVariableName =  "John"          Snake Case :  my_variable_name =  "John"     Assign Values 1.    x, y, z =  "Orange" ,  "Banana" ,  "Cherry" 2.  x = y = z =  "Orange" 3. fruits = [ "apple" ,  "banana" ,  "cherry" ]     x, y, z = fruits Global Variables : variable created outside of function.(by using Global keyword use can...

Day - Python (Programming Basic )

 Python  1. Algorithm :- Write easy and simple steps to solve any problem. 2. Flowchart :- To describe any problem solution using special chart or pictorial representation of any program flow.

Day 2 Python (Introduction)

                                        Python  Introduction:-            Python Created by Guido Van Rossum in 1991. & its High Level language Used 1. Web Development  2. Software Development 3.Mechine learning 4. AI 6. Data Mining Advantages: 1. Works on different Platform( Window, Mac, Linux, ) 2. Simple, easy and use Interpreter System to run the code 3.Python Version Python -1, Python 2, Python -3 4. Case sensitive language (like AGE, age, Age are different variable) Installation  Goto  https://www.python.org/  or Click here Software for Run Python :- Visual Studio Code Download , Pycharm Download