Web Application Development using Python (CSEO E02) PDF
Document Details
Uploaded by SportySatellite
DDU Gorakhpur University
ANU RAJ
Tags
Summary
This PowerPoint presentation covers Web Application Development using Python (CSEO E02). It includes topics such as basic Python concepts, flow control, and exception handling. The presentation is likely part of a computer science course at DDU Gorakhpur University.
Full Transcript
Web Application Development using Python(CSEO E02) BY ANU RAJ ASSISTANT PROFESSOR DDU GORAKHPUR Content ⮚ Python Basics-Standard types ⮚Flow Control structures ⮚Exception Handling ⮚String ⮚List ⮚Tuple ⮚File ⮚Function ⮚Dictionary ⮚OOPS Standard Types in Python Python provides...
Web Application Development using Python(CSEO E02) BY ANU RAJ ASSISTANT PROFESSOR DDU GORAKHPUR Content ⮚ Python Basics-Standard types ⮚Flow Control structures ⮚Exception Handling ⮚String ⮚List ⮚Tuple ⮚File ⮚Function ⮚Dictionary ⮚OOPS Standard Types in Python Python provides several standard data types that are built into the language. These types allow the storage and manipulation of various kinds of data: Numeric Types: ⮚int: Represents integers (e.g., 5, -10). ⮚float: Represents floating-point numbers (e.g., 3.14, -0.001). ⮚complex: Represents complex numbers (e.g., 3+4j). Sequence Types: ⮚str: Represents a sequence of characters (strings) (e.g., 'hello’). ⮚list: An ordered, mutable sequence of items (e.g., [1, 2, 3]). ⮚tuple: An ordered, immutable sequence of items (e.g., (1, 2, 3)) Standard Types in Python Mapping Type: ⮚dict: Stores key-value pairs, like a hash map or associative array (e.g., {'name': 'Alice', 'age': 25}). Set Types: ⮚set: An unordered collection of unique items (e.g., {1, 2, 3}). ⮚Frozen set: An immutable version of a set. Boolean Type: ⮚bool: Represents True or False. Python Basic Flow Control Flow control in Python allows you to dictate how your program executes based on conditions and loops. Here are the key components: 1. Conditional Statements (if, elif, else) Used to execute code blocks based on specific conditions. if condition: # Block of code if condition is True elif another_condition: # Block of code if another_condition is True else: # Block of code if none of the above conditions are True Flow Control-Conditional Statements (if, elif, else) Eg- x = 10 if x > 10: print("Greater than 10") elif x == 10: print("Equal to 10") else: print("Less than 10") Flow Control-Loops a. For Loop Used to iterate over sequences like lists, tuples, strings, etc. fruits = ["apple", "banana", "cherry"] for fruit in fruits: print(fruit) b. While Loop Executes a block of code as long as a condition is True. i=1 while i