1 / 37

Python Programming | Python Programming For Beginners | Python Tutorial | Edureka

This Edureka Python Programming tutorial will help you learn python and understand the various basics of Python programming with examples in detail. Below are the topics covered in this tutorial: <br><br>1. Python Installation <br>2. Python Variables <br>3. Data types in Python <br>4. Operators in Python <br>5. Conditional Statements <br>6. Loops in Python <br>7. Functions in Python <br>8. Classes and Objects

EdurekaIN
Télécharger la présentation

Python Programming | Python Programming For Beginners | Python Tutorial | Edureka

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EDUREKA PYTHON CERTIFICATION TRAINING Python Programming www.edureka.co/python

  2. Agenda ➢ Install Python ➢ Install PyCharm - IDE for Python ➢ Python Programming ▪ Variables ▪ Data types ▪ Operators ▪ Conditional Statements ▪ Loops ▪ Functions ▪ Classes and Objects ➢ Summary www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  3. Python Installation www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  4. Pycharm Installation www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  5. Conditional Statements Functions Data types Operators Classes and Objects Loops Variables www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  6. Python Variable Variable Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. Memory A=16 A = 16 B = 20 C = ‘edureka’ Memory B=20 Memory C=‘edureka’ www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  7. Data types Conditional Statements Functions Operators Classes and Objects Loops Variables www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  8. Python Data types Data types A data type, in programming, is a classification that specifies which type of value a variable has and what type of mathematical, relational or logical operations can be applied to it without causing an error. Integer Datatype A=16 A = 16 B = 20 C = ‘edureka’ Integer Datatype B=20 String Datatype C=‘edureka’ www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  9. Python Data types Data types List Strings Dictionary Tuple Set Numeric www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  10. Numeric Data type  Number data types are used to store numeric values.  There are four different numerical types in Python: 1 Numeric 3 2 Lists A = 16 Integer Type 3 Tuples B = 1.678 Float Type 4 Strings C = 2 + i6 5 Set Complex Type 6 Dictionary D = 909065*35353537 Long Type www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  11. List Data type The list is a most versatile datatype available in Python which can be written as a list of comma-separated values (items) between square brackets 1 Numeric For example: list1 = ['physics', 'chemistry', 1997, 2000] 2 2 Lists Accessing Values in Lists 3 Tuples Updating List 4 Strings Delete List Elements List Length 5 Set Concatenation 6 Dictionary Repetition www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  12. Tuples Data type A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists. 1 Numeric Tup1 = ('physics', 'chemistry', 1997, 2000) For example: 3 2 Lists Accessing Values in Tuple 2 3 Tuples Tuples 3 Updating Tuple 4 Strings Delete Tuple Elements Tuple Length 5 Set Concatenation 6 Dictionary Repetition www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  13. String Data type A string in Python is a sequence of characters. We can create Strings by enclosing characters in quotes. Python treats single quotes the same as double quotes. Consider the example below: 1 Numeric A = ‘Master Python At edureka’ B = ‘Welcome to edureka!’ 3 2 Lists 3 Tuples Operation Syntax String Length print(len(string_name)) 2 4 Strings Strings 4 Locate a character in string print(strig_name.index(“Char")) Count the number of times a character is repeated in a string print(string_name.count("Char")) 5 Set Print a part of the string print(string_name[start:stop]) Reverse a string print(string_name[::-1]) 6 Dictionary Convert the letters in a string to upper-case print(string_name.upper()) Convert the letters in a string to lower-case print(string_name.lower()) www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  14. Set Data type 1 Numeric Set is an unordered collection of unique items. Set is defined by values separated by comma inside braces { }. 3 2 Lists 3 Tuples For Example: 4 Strings 2 5 Set 5 4 Strings Set 6 Dictionary www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  15. Dictionary Data type 1 Numeric Dictionary is an unordered collection of key-value pairs. It is generally used when we have a huge amount of data. 3 2 Lists For Example: 3 Tuples 4 Strings 5 Set 2 6 Dictionary Dictionary 5 4 Strings Set 6 www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  16. Conditional Statements Functions Data types Classes and Objects Loops Variables Operators www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  17. Python Operations Operations Operators are the constructs which can manipulate the value of operands. Comparison Operators Membership Operators Identity Operators Bitwise Operators Logical Operators Operators Assignment Operators Arithmetic Operators www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  18. Arithmetic and Comparison Operators Arithmetic Comparison a + b Addition a == b Equal To a – b Subtraction a != b Not Equal To a * b Multiplication a > b Greater Than a / b Division Less Than a < b a % b Modulus Greater Than Equal To a >= b a ** b Exponent Less Than Equal To a <= b www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  19. Assignment and identity Operator Assignment Identity a = b Assigns value from right to left Evaluates to true if the variables on either side of the operator point to the same object and false otherwise. a + = b a = a + b is a - = b a = a - b a * = b Evaluates to false if the variables on either side of the operator point to the same object and true otherwise. a = a*b is not a /= b a = a/b a** = b a = a**b www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  20. Membership and Bitwise Operator Membership Bitwise a & b Binary AND Evaluates to true if it finds a variable in the specified sequence and false otherwise. in a | b Binary OR a ^ b Binary XOR a ~ b Evaluates to true if it does not find a variable in the specified sequence and false otherwise. Binary NOT not in a << Binary Left Shift a >> b Binary Right Shift www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  21. Logical Operator There are three types of logical operators: Logical AND, Logical NOT, Logical OR Returns a if a is false, b otherwise a and b Returns b if b is false, a otherwise a or b not a Returns True if a is True, False otherwise www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  22. Conditional Statements Functions Data types Classes and Objects Loops Variables Operators www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  23. Conditional Statements in Python If Statement Start Syntax: Condition is false Exit Condition Condition is true If code End www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  24. Conditional Statements in Python Elif Statement Start Syntax: Condition Elif code If condition is false Condition is true If code End www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  25. Conditional Statements in Python Else Statement Start Condition Syntax: If condition is false If condition is true Elif condition is false Else code If code Elif code End www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  26. Conditional Statements Functions Data types Classes and Objects Variables Operators Loops www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  27. Loops in Python A loop statement allows us to execute a statement or group of statements multiple times. The following diagram illustrates a loop statement: Loops Start Loops Conditional Code If condition is true Condition For While Nested If condition is false End www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  28. While Loop Repeats a statement or group of statements while a given condition is TRUE. It tests the condition before executing the loop body. While Loop Start Syntax: Condition If condition is true If condition is false Conditional Code End www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  29. For Loop Repeats a statement or group of statements while a given condition is TRUE. It tests the condition before executing the loop body. For Loop Start Syntax: If no more items in the sequence Item from sequence Next item from sequence Execute Statement (s) End www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  30. Nested Loops in Python Python programming language allows use of one loop inside another loop. This is called Nested Loop, below is the syntax for the same: Nested Loops Syntax: Syntax: www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  31. Functions Conditional Statements Data types Classes and Objects Variables Operators Loops www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  32. Functions in Python A function is a block of organized, reusable code that is used to perform a single, related action. Functions Function Add Functions Call 1 Return 8 Call (3,5) Call 2 Predefined Functions User Defined Functions Call (6,9) Return 15 Call 3 Call (1,5) Return 6 www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  33. Conditional Statements Functions Data types Variables Operators Loops Classes and Objects www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  34. Classes and Objects in Python  A class is the blueprint from which specific objects are created.  Anything that has a state and behavior is object. Classes and Objects Class Object www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  35. Session In A Minute Conditional Statements Variables, Data types, Operators Install Python Classes and Objects Loops Functions www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

  36. Thank You … Questions/Queries/Feedback www.edureka.co/python EDUREKA PYTHON CERTIFICATION TRAINING

More Related