संदेश

PYTHON लेबल वाली पोस्ट दिखाई जा रही हैं

CONDITIONAL STATEMENTS IN PYTHON

चित्र
PYTHON CONDITIONAL STATEMENTS There are situations in real life when we need to make some decisions and based on these decisions, we decide what we should do next. Similar situations arise in programming also where we need to make some decisions and based on these decisions we will execute the next block of code. Conditional statements in Python languages decide the direction(Control Flow) of the flow of program execution. Types of S tatements in Python There are 4 types of Statements in Python... 1. The if statement 2. The if-else statement 3. The nested-if statement 4. The if-elif-else ladder if statement The if statement is the most simple decision-making statement. It is used to decide whether a certain statement or block of statements will be executed or not. Syntax: if condition:    # Statements to execute if    # condition is true Here, the condition after evaluation will be either true or false. if the statement accepts boolean values-if the value is true the...

PYTHON OPERATORS

चित्र
Python Operators Operators are special symbols that perform operations on variables and values. Example: print(5 + 6)   # 11 Here, + is an operator that adds two numbers: 5 and 6. Types of Python Operators There are 7 types of Python operators... 1. Arithmetic Operators 2. Assignment Operators 3. Comparison Operators 4. Logical Operators 5. Bitwise Operators 6. Identity Operators 7. Membership Operators 1. Python Arithmetic Operators Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication, etc. Example: sub = 10 - 5 # 5 Here, - is an arithmetic operator that subtracts two values or variables. 2. Python Assignment Operators Assignment operators are used to assign values to variables. For example, # assign 5 to x  var x = 5 Here, = is an assignment operator that assigns 5 to x. 3. Python Comparison Operators Comparison operators compare two values/variables and return a boolean result: True or False. Example: a = 5 b =2 pr...

CASTING, STRING, BOOLEAN

चित्र
Casting in Python Casting is a process of converting a variable's data type into another data type. If you want to specify the data type of a variable, this can be done with casting. Example: x = str(3)    # x will be '3' y = int(3)    # y will be 3 z = float(3)  # z will be 3.0 Python String Python string is the collection of the characters surrounded by single quotes, double quotes, or triple quotes. In Python, strings can be created by enclosing the character or the sequence of characters in the quotes. Python allows us to use single quotes, double quotes, or triple quotes to create the string. Creating a string in Python Syntax: str = "Hi Python !"     Here, if we check the type of the variable str using a Python script print(type(str)), then it will print a string (str).     In Python, strings are treated as the sequence of characters, which means that Python doesn't support the character data-type; instead, a single character...

PYTHON DATA TYPES

चित्र
DATA TYPES OF PYTHON Data types are the classification or categorization of data items. Python supports the following built-in data types. Scalar Types 1. int: Positive or negative whole numbers (without a fractional part) e.g. -10, 10, 456, 4654654. 2. float: Any real number with a floating-point representation in which a fractional component is denoted by a decimal symbol or scientific notation e.g. 1.23, 3.4556789e2. 3. complex: A number with a real and imaginary component represented as x + 2y. 4. bool: Data with one of two built-in values True or False. Notice that 'T' and 'F' are capital. true and false are not valid booleans and Python will throw an error for them. None: The None represents the null object in Python. A None is returned by functions that don't explicitly return a value. Sequence Type A sequence is an ordered collection of similar or different data types. Python has the following built-in sequence data types... 1. String: A string value is...

PYTHON FEATURES, SETTING UP PATH BASIC SYNTAX, COMMENTS, VARIABLE

चित्र
FEATURES, SETTING UP PATH BASIC SYNTAX, COMMENTS, VARIABLE Python is a feature rich high-level, interpreted, interactive and object-oriented scripting language. Features of Python There are some important features of Python programming language... 1. Easy to Learn This is one of the most important reasons for the popularity of Python. Python has a limited set of keywords. Its features such as simple syntax, usage of indentation to avoid clutter of curly brackets and dynamic typing that doesn't necessitate prior declaration of variable help a beginner to learn Python quickly and easily. 2. Interpreter Based Any Programming languages is either compiler based or interpreter based.  Python is an interpreter based language. The interpreter takes one instruction from the source code at a time, translates it into machine code and executes it. Instructions before the first occurrence of error are executed. With this feature, it is easier to debug the program and thus proves useful for the ...

INTRODUCTION TO PYTHON HISTORY

चित्र
PYTHON HISTORY Python is a popular programming language. It is designed by Guido van Rossum  in 1991 . Nowadays, Python is one of the most popular and widely used programming language all over the world. It is a high-level programming language.  It's syntax allows programmers to express concepts in fewer lines of code. It is used for set of tasks including console based, GUI based, web programming and data analysis. Python is a easy to learn and simple programming language so even if you are new to programming, you can learn python without facing any problems. Story behind Python's invention In the late 1980s, working on Python started by Guido Van Rossum. He began doing its application-based work in December of 1989 at Centrum Wiskunde & Informatica (CWI) which is situated in the Netherlands. It was started as a hobby project because he was looking for an interesting project to keep him occupied during Christmas. From ABC language to Python The success of Python programm...

PYTHON

चित्र
PYTHON PROGRAMMING LANGUAGE ALL PYTHON TOPICS HERE 1. INTRODUCTION TO PYTHON HISTORY 2. FEATURES, SETTING UP PATH BASIC SYNTAX, COMMENTS, VARIABLE 3. DIFFERENT DATA TYPES 4. CASTING, STRING, BOOLEAN 5. PYTHON OPERATORS 6. CONDITIONAL STATEMENTS 7. LOOPING 8. CONTROL STATEMENTS, STRING MANIPULATION, LISTS, TUPLE, SETS 9. DICTIONARIES 10. ARRAYS 11. ITERATORS, MODULES, DATES, MATH 12. MODULES, INPUT AND OUTPUT 13. FUNCTION & ARGUMENTS 14. MODULES 15. EXCEPTION HANDLING 16. BUILT IN FUNCTION IN PYTHON 17. FILE HANDLING IN PYTHON 18. PYTHON ARCHITECTURE 19. DOCUMENTATION IN PYTHON