Header Ads

AI/ML PYTHON ( B.Tech CSE)


 AI/ML PYTHON


What is Python?

Python is general purpose programming language.

we use for create software / coding.

  • What means Coding?
Coding means decoding ( do short of coding language )

  • Who invent Python and When?
Guido van Rossum,

Python invent in 1889 but Launched PubliPublicly  in 1991.

  • How Python Names Come?
While you may know the python as a large snake, the name of the Python programming language comes from an old BBC television comedy sketch series called Monty Python's Flying Circus.

  • What is Syntax of Python?
print ("Hello world")

  • What is Features of Python?

Python has many features, including:

Portable
: We can Decode python in Anywhere.
Dynamic: Flexible, No need to instructions.
Independent: Do not Depended on Platform.
Multiparallelism: We can use all types of coding.
  • Easy to learn: Python has a simple syntax and is considered a high-level language, which means it's designed to be easy for humans to write and understand. 
  • Object-oriented: Python is an object-oriented programming language that supports constructs like inheritance, polymorphism, encapsulation, and classes. This allows for code reuse and efficient application building. 
  • Portable: Python is a cross-platform language that can be used on multiple platforms. 
  • Open source: Python is free and open source software. 
  • Large standard library: Python comes with a comprehensive standard library. 
  • Dynamically typed: Python is dynamically typed. 
  • Flexible data handling: Python variables can hold various data types, including integers, floats, strings, booleans, tuples, and lists. 
  • Community support: Python has a large community of support. 

Arvindx
  • What is Print / Print F ?
Print : ( print is function) Print is use for input get for output.

  • What is Variable?
As a Identify use in Python ( Define memory location,verify address locate in any Program.

  • Print 
Name,Roll NO, Course,Address

print ("Arvind")
print ("18")
print ("B.Tech")
print ("Patna")

  • In 1991 
Map, Filter, Lamda

  • In 2000
Garbage collection,system

  • What is Tokens?
Smallest Particle of Coding( Smallest Unit Of Program)

  • Five Types Of Tokens
  1.  Keywords   
  2. Strings
  3. Operator
  4. Constant
  5. Special Value ( Symbol)
  • Keywords: Keywords are reserve words which are define in compiler of specific program.

  • Strings: (" Hello") : Any Value Which is Writeen in Double Cotted.
Strings always Excute With NULL value , always count null value in strings.

  • Operator: Any Mathical , Calculation, Logical Which Perform is called Operator.

  • Constant: ( a=5)  Any fixed value is constant

  • Special Value ( Symbol) [!, #, %, ;, ? ]

  • Variables
Variables: Need to Define
Dynamic Type Variables : No need to Define Because Features of Python.( Dynamic Features)



 DATA TYPES  

  • What is Data Types ?
Data types is use to Define Variables.

  • No Of Data Types in Python 
  • Classifications of Data Types

  1. Numeric Types
  2. Dictionary Types
  3. Boolean Types
  4. Set Types 
  5. Sequence Types
  • Numeric: 
  1. int   ex: ( 10,1,2,3)
  2. float  ex: ( 1.0, 1.1 , 0.1)
  3. complex  ex: ( 3f4gu6)
  • Sequence:
  1. Strings : ("  ")   ('   ')
  2. List : Order Way Create Data, Sequence ( Mutable ) can Modified
  3. Tuple: UnordeUnordered: Immutable ( Not Modified ) Single string( '   ' )  , Small Bracket 
  • Dictionary:  
A dictdictionary is an unordered mutable and index collection of key value pairs it is one of the python in built data types that is define use in curely curly bracket {}.

SYNTAX: dict={'Name':'Age'}

  • Boolean:

(True or False )
(Either True or Either False )
(Yes or No )

  • Set:
Set Define,Set ,Sequence 


  • LIST & TUPLE

  •            students=["cat","dog"]
                    print("fruits")
output:         fruits

  •             students=["raj","prince"]
                    print(students)
output:         ['raj','prince']

Add students use append

  •            students.append("piyush")
                    print(students)
output:         ['raj','prince','piyush']

Remove Students

  •            students.remove("piyush")
                    print(students)
output:         ['raj','prince']

  •             coordinates=(3,5)
                    print (coordinates)
output:          (3,5)

  •             coordinates=(3,5)
                     print('x-coordinates;",coordinates[0])
output:         x-coordinates;3


  •          coordinates=(3,5)
                  print(coordinates)
                  print("y-coordinates;",coordinates[1])
                   (3,5)
output:         x-coordinates;5

  •           coordinates=(3,5,7)
                  print("z-coordinates;",coordinates[2])
                  (3,5,7)
output      : x-coordinates;7


  •   a=20
            b=30
            print("sum is",a+b)
output: sum is 50

  • a=40
            b=5
          print("difference is",a-b)
output: difference is 35

  •  a=50
           b=7
           print("product is",a*b)
output: product is 350

  •   a=30
            b=10
           print("divide is",a/b)
output: divide is 3



  • What is REPL ?
REPL is Mode of Communication of Python.

REPL:-REPL is a mode of communication (communicate to python integrator for example if used excused any file in python library to set immediate output

REPL is an acronym for Read, Evaluate, Print, and Loop. Developers use REPL Python to communicate with the Python Interpreter. In contrast to running a Python file, you can input commands in the REPL and see the results displayed immediately.


Arvindx

  • Count Number of Tokens use in above Code.
x=2
print(xyz)
y=2

answer = 9

print(xyz) +1 : NULL value always count in strings.















No comments

App Privacy Policy

Privacy Policy 🚀This privacy policy applies to the Earning Crizz app (hereby referred to as "Application") for mobile devices tha...

Powered by Blogger.