Python is a high-level, interpreted and general-purpose dynamic programming language that focuses on code readability. The syntax in Python helps programmers write code in fewer steps as compared to languages like Java or C++. Character set in Python includes letters, digits, special symbols, and whitespace. Tokens or lexical units are the basic elements identified in a programming language like keywords, identifiers, literals, operators, and punctuators.
This document provides an introduction to Python fundamentals. It discusses Python's character set, tokens or lexical units including keywords, identifiers, literals, operators, and punctuators. It also covers Python programming concepts such as variables and assignments, functions, comments, statements, and programming conventions regarding whitespace, maximum line length, and case sensitivity. The document aims to explain the basic building blocks of the Python language to learn Python programming.
This document provides an introduction to Python fundamentals, including character sets, tokens, identifiers, literals, operators, punctuators, whitespace, comments, statements, and functions. It defines each concept and provides examples. The character set in Python includes letters, digits, special symbols, and whitespace. Tokens include keywords, identifiers, literals, operators, and punctuators. Identifiers are names given to objects in a program. Literals represent fixed values through strings, integers, floats, Booleans, and collections. Operators trigger computations on variables. Punctuators separate language elements while whitespace ensures readability. Comments are non-executable notes. Statements are program instructions and functions define reusable blocks of code.
This document provides an introduction to Python fundamentals, including character sets, tokens, identifiers, literals, operators, punctuators, whitespace, comments, statements, and functions. It defines keywords, strings, integers, floats, Booleans, and collections as types of literals. It also covers Python naming conventions and escape sequences for strings.
This document provides an introduction to Python fundamentals including character sets, tokens, keywords, identifiers, literals, operators, punctuators, comments, and functions. It defines each concept and provides examples. It also discusses Python programming conventions like indentation, line length, and whitespace. Finally, it covers variables and assignments, dynamic typing, the type() function, input() function, and print() function.
This document provides an introduction to Python fundamentals, including:
- Python's character set includes letters, digits, symbols, and whitespace. Tokens are the basic elements identified by Python like keywords, identifiers, literals, operators, and punctuators.
- Keywords are reserved words in Python that cannot be used as identifiers. Identifiers are names given to objects in Python like variables and functions. Literals represent constant values like strings, numbers, Booleans, and collections.
- Strings can be single, multi-line, or use escape sequences. Numbers can be integers, floats, or complex. Boolean literals are True and False. Functions are self-contained blocks that perform tasks.
-
This document provides an introduction to Python fundamentals, including:
1. The Python character set includes letters, digits, symbols, and whitespace. Individual elements are called tokens or lexical units.
2. Keywords, identifiers, literals, operators, and punctuators are the main types of tokens. Identifiers follow specific naming conventions. Literals include strings, numbers, Booleans, None, and collections.
3. Strings can be single or multi-line with escape sequences. Numbers can be integers, floats, or complex. True, False, and None are Boolean and special literals.
Introduction to Python for Data Science and Machine Learning ParrotAI
This document provides an introduction and overview of Python for data science and machine learning. It covers basics of Python including what Python is, its features, why it is useful for data science. It also discusses installing Python, using the IDLE and Jupyter Notebook environments. The document then covers Python basics like variables, data types, operators, decision making and loops. Finally, it discusses collection data types like lists, tuples and dictionaries and functions in Python.
After the end of lesson you will be able to learn Python basics-What Python is? Its releases. Where we can use Python? Python Features. Tokens, comments variables etc... In out next PPT you will learn how to input and get output in Python
This document provides an introduction to Python fundamentals. It discusses Python's character set, tokens or lexical units including keywords, identifiers, literals, operators, and punctuators. It also covers Python programming concepts such as variables and assignments, functions, comments, statements, and programming conventions regarding whitespace, maximum line length, and case sensitivity. The document aims to explain the basic building blocks of the Python language to learn Python programming.
This document provides an introduction to Python fundamentals, including character sets, tokens, identifiers, literals, operators, punctuators, whitespace, comments, statements, and functions. It defines each concept and provides examples. The character set in Python includes letters, digits, special symbols, and whitespace. Tokens include keywords, identifiers, literals, operators, and punctuators. Identifiers are names given to objects in a program. Literals represent fixed values through strings, integers, floats, Booleans, and collections. Operators trigger computations on variables. Punctuators separate language elements while whitespace ensures readability. Comments are non-executable notes. Statements are program instructions and functions define reusable blocks of code.
This document provides an introduction to Python fundamentals, including character sets, tokens, identifiers, literals, operators, punctuators, whitespace, comments, statements, and functions. It defines keywords, strings, integers, floats, Booleans, and collections as types of literals. It also covers Python naming conventions and escape sequences for strings.
This document provides an introduction to Python fundamentals including character sets, tokens, keywords, identifiers, literals, operators, punctuators, comments, and functions. It defines each concept and provides examples. It also discusses Python programming conventions like indentation, line length, and whitespace. Finally, it covers variables and assignments, dynamic typing, the type() function, input() function, and print() function.
This document provides an introduction to Python fundamentals, including:
- Python's character set includes letters, digits, symbols, and whitespace. Tokens are the basic elements identified by Python like keywords, identifiers, literals, operators, and punctuators.
- Keywords are reserved words in Python that cannot be used as identifiers. Identifiers are names given to objects in Python like variables and functions. Literals represent constant values like strings, numbers, Booleans, and collections.
- Strings can be single, multi-line, or use escape sequences. Numbers can be integers, floats, or complex. Boolean literals are True and False. Functions are self-contained blocks that perform tasks.
-
This document provides an introduction to Python fundamentals, including:
1. The Python character set includes letters, digits, symbols, and whitespace. Individual elements are called tokens or lexical units.
2. Keywords, identifiers, literals, operators, and punctuators are the main types of tokens. Identifiers follow specific naming conventions. Literals include strings, numbers, Booleans, None, and collections.
3. Strings can be single or multi-line with escape sequences. Numbers can be integers, floats, or complex. True, False, and None are Boolean and special literals.
Introduction to Python for Data Science and Machine Learning ParrotAI
This document provides an introduction and overview of Python for data science and machine learning. It covers basics of Python including what Python is, its features, why it is useful for data science. It also discusses installing Python, using the IDLE and Jupyter Notebook environments. The document then covers Python basics like variables, data types, operators, decision making and loops. Finally, it discusses collection data types like lists, tuples and dictionaries and functions in Python.
After the end of lesson you will be able to learn Python basics-What Python is? Its releases. Where we can use Python? Python Features. Tokens, comments variables etc... In out next PPT you will learn how to input and get output in Python
This document provides an introduction to C++ programming, covering key concepts like characters, tokens, keywords, identifiers, literals, operators, input/output, variables, comments, and common errors. It explains that C++ was created by Bjarne Stroustrup in the 1980s as an extension of C with object-oriented features from Simula 67.
This document provides an introduction to C++ programming, covering key concepts like characters, tokens, keywords, identifiers, literals, operators, I/O streams, variables, comments, and common errors. It explains that Bjarne Stroustrup extended C to create C++, adding object-oriented features from Simula. The main components discussed are the building blocks of any C++ program - characters, tokens, data types, and basic input/output operations.
First in the series of slides for python programming, covering topics like programming language, python programming constructs, loops and control statements.
This document provides an overview of the Python programming language. It discusses that Python is an interpreted, interactive, object-oriented language and was created by Guido van Rossum. It then covers getting and installing Python, writing basic Python programs, variables and data types, operators, control flow statements like if/else, and other core concepts like functions, modules, and exceptions.
The document discusses Java's primitive data types including their ranges and literal constants. It covers char, boolean, byte, short, int, long, float, and double data types. It also discusses variables, symbolic constants, and arithmetic operators.
This document provides an introduction to Python programming concepts such as keywords, identifiers, comments, variables, data types, and literals. It defines keywords as reserved words in Python that have special meanings. Identifiers are names given to variables and other objects. Comments are notes for making code more readable. Variables are containers that hold data values. Literals represent fixed values like numbers and strings. The document also discusses Python data types like integers, floats, booleans, lists, tuples, dictionaries and sets.
This document provides an overview of the Python programming language. It discusses what Python is, its key features, who uses it, common applications, and how to download and install Python. It then covers Python syntax concepts like identifiers, keywords, multiline statements, docstrings, indentation, comments, and string formatting. The document also introduces Python data types like numbers, strings, lists, tuples, dictionaries, sets and how to work with them. It describes how to convert between number types and access/update strings and lists. Finally, it discusses Python development environments like Anaconda and Spyder.
This document provides an overview of C programming and data structures. It begins with an introduction to C language concepts like data types, variables, constants, I/O functions, operators, and control statements. It then discusses the history and evolution of C from earlier languages like ALGOL and BCPL. The document outlines characteristics of C and its applications. It also covers topics like keywords, identifiers, data type sizes, variable naming rules, and comment syntax. Library functions for input/output like scanf and printf are explained. The different types of constants in C like integer, real, character, and string constants are defined along with their syntax rules.
This document provides an introduction to C++ tokens, including keywords, identifiers, literals, punctuators, and operators. It discusses the C++ character set and how a program is constructed using different tokens. Key points covered include:
- The basic building blocks of a C++ program are tokens like keywords, identifiers, literals, punctuators, and operators.
- Literals include integer, character, floating, string, and Boolean constants. Punctuators include brackets, parentheses, braces, commas, semicolons, and other special characters.
- The main types of operators are arithmetic, relational, logical, unary, assignment, conditional, and comma operators.
Guido van Rossum emphasized the importance of code readability in Python. He introduced significant whitespace as a core feature of the language, aiming to enforce a clean and readable code structure. This emphasis on readability is evident in the presentation's mention of Python's design philosophy that highlights code readability.Van Rossum emphasized the importance of Python in enabling developers to write clear and logical code, which is scalable for both small and large-scale projects. The presentation mentions Python's language constructs and object-oriented approach designed to assist programmers in achieving this goal.
Though not explicitly attributed to van Rossum, Python's dynamically typed nature and built-in garbage collection contribute to its ease of use and simplification of memory management, reflecting the language's user-centric design principles.
Overall, Guido van Rossum's vision and design choices for Python resonate with the attributes and philosophies outlined in the presentation. His influence is seen in Python's core principles, which prioritize readability, versatility, and ease of use for programmers.
This document discusses variables in C++, including data types, identifiers, and variable declaration. It provides the following key points:
- Data types specify the type of data a variable can store (e.g. int, float, char) and determine how much memory is allocated. Common fundamental data types include integers, floating point numbers, booleans, characters, and strings.
- Identifiers are names given to variables and follow naming rules like starting with a letter and not being a reserved keyword. Variables must be declared before use by specifying the data type.
- Declaration syntax is the data type followed by the variable name(s). For example, "int x, y;" declares two integer variables.
The document discusses Python programming concepts such as data types, variables, operators, and input/output. It provides examples of Python code and explains key features like:
- Python supports several data types including integers, floats, booleans, strings, and lists.
- Variables store and label values that can be of different data types. Variables are created using names.
- Operators like arithmetic, comparison, and logical operators are used to manipulate values.
- User input and output is handled through functions like print() and input().
- Comments, indentation, and quotation are syntax elements in Python code.
C++ was created in the 1980s by Bjarne Stroustrup as an extension of the C language with object-oriented features. It combined features from C and Simula 67. The document provides an overview of the basic building blocks of C++ programs including characters, tokens, keywords, identifiers, literals, punctuators, operators, comments, streams, variables, and common errors. It describes the different data types and rules for writing identifiers, literals, and comments. It also explains common tokens like keywords, operators, and punctuators and how they are used in C++.
This document provides an overview of the C programming language. It discusses that C was developed in 1972 at Bell Labs and is a popular systems and applications programming language. The document then covers various C language concepts like data types, variables, operators, input/output functions, and provides examples of basic C programs and code snippets.
The document outlines topics to be covered in a C programming course, including structure of C programs, identifiers, data types, constants, variables, expressions, and operators. It provides details on each topic in 3 sentences or less:
The structure of a C program consists of functions, with one function called main executing first. Functions contain a heading, argument declarations, and a compound statement enclosed in braces. Compound statements can be nested and expressions must end with semicolons.
Python and Perl are both high-level programming languages. Python is an interpreted language with clear, readable syntax and intuitive object orientation. Perl is also an interpreted and dynamic language that supports both procedural and object-oriented programming and is best known for powerful text processing. Both languages have a long history and are widely used for web development, scientific computing, and other tasks.
Introduction- e - waste – definition - sources of e-waste– hazardous substances in e-waste - effects of e-waste on environment and human health- need for e-waste management– e-waste handling rules - waste minimization techniques for managing e-waste – recycling of e-waste - disposal treatment methods of e- waste – mechanism of extraction of precious metal from leaching solution-global Scenario of E-waste – E-waste in India- case studies.
This document provides an introduction to C++ programming, covering key concepts like characters, tokens, keywords, identifiers, literals, operators, input/output, variables, comments, and common errors. It explains that C++ was created by Bjarne Stroustrup in the 1980s as an extension of C with object-oriented features from Simula 67.
This document provides an introduction to C++ programming, covering key concepts like characters, tokens, keywords, identifiers, literals, operators, I/O streams, variables, comments, and common errors. It explains that Bjarne Stroustrup extended C to create C++, adding object-oriented features from Simula. The main components discussed are the building blocks of any C++ program - characters, tokens, data types, and basic input/output operations.
First in the series of slides for python programming, covering topics like programming language, python programming constructs, loops and control statements.
This document provides an overview of the Python programming language. It discusses that Python is an interpreted, interactive, object-oriented language and was created by Guido van Rossum. It then covers getting and installing Python, writing basic Python programs, variables and data types, operators, control flow statements like if/else, and other core concepts like functions, modules, and exceptions.
The document discusses Java's primitive data types including their ranges and literal constants. It covers char, boolean, byte, short, int, long, float, and double data types. It also discusses variables, symbolic constants, and arithmetic operators.
This document provides an introduction to Python programming concepts such as keywords, identifiers, comments, variables, data types, and literals. It defines keywords as reserved words in Python that have special meanings. Identifiers are names given to variables and other objects. Comments are notes for making code more readable. Variables are containers that hold data values. Literals represent fixed values like numbers and strings. The document also discusses Python data types like integers, floats, booleans, lists, tuples, dictionaries and sets.
This document provides an overview of the Python programming language. It discusses what Python is, its key features, who uses it, common applications, and how to download and install Python. It then covers Python syntax concepts like identifiers, keywords, multiline statements, docstrings, indentation, comments, and string formatting. The document also introduces Python data types like numbers, strings, lists, tuples, dictionaries, sets and how to work with them. It describes how to convert between number types and access/update strings and lists. Finally, it discusses Python development environments like Anaconda and Spyder.
This document provides an overview of C programming and data structures. It begins with an introduction to C language concepts like data types, variables, constants, I/O functions, operators, and control statements. It then discusses the history and evolution of C from earlier languages like ALGOL and BCPL. The document outlines characteristics of C and its applications. It also covers topics like keywords, identifiers, data type sizes, variable naming rules, and comment syntax. Library functions for input/output like scanf and printf are explained. The different types of constants in C like integer, real, character, and string constants are defined along with their syntax rules.
This document provides an introduction to C++ tokens, including keywords, identifiers, literals, punctuators, and operators. It discusses the C++ character set and how a program is constructed using different tokens. Key points covered include:
- The basic building blocks of a C++ program are tokens like keywords, identifiers, literals, punctuators, and operators.
- Literals include integer, character, floating, string, and Boolean constants. Punctuators include brackets, parentheses, braces, commas, semicolons, and other special characters.
- The main types of operators are arithmetic, relational, logical, unary, assignment, conditional, and comma operators.
Guido van Rossum emphasized the importance of code readability in Python. He introduced significant whitespace as a core feature of the language, aiming to enforce a clean and readable code structure. This emphasis on readability is evident in the presentation's mention of Python's design philosophy that highlights code readability.Van Rossum emphasized the importance of Python in enabling developers to write clear and logical code, which is scalable for both small and large-scale projects. The presentation mentions Python's language constructs and object-oriented approach designed to assist programmers in achieving this goal.
Though not explicitly attributed to van Rossum, Python's dynamically typed nature and built-in garbage collection contribute to its ease of use and simplification of memory management, reflecting the language's user-centric design principles.
Overall, Guido van Rossum's vision and design choices for Python resonate with the attributes and philosophies outlined in the presentation. His influence is seen in Python's core principles, which prioritize readability, versatility, and ease of use for programmers.
This document discusses variables in C++, including data types, identifiers, and variable declaration. It provides the following key points:
- Data types specify the type of data a variable can store (e.g. int, float, char) and determine how much memory is allocated. Common fundamental data types include integers, floating point numbers, booleans, characters, and strings.
- Identifiers are names given to variables and follow naming rules like starting with a letter and not being a reserved keyword. Variables must be declared before use by specifying the data type.
- Declaration syntax is the data type followed by the variable name(s). For example, "int x, y;" declares two integer variables.
The document discusses Python programming concepts such as data types, variables, operators, and input/output. It provides examples of Python code and explains key features like:
- Python supports several data types including integers, floats, booleans, strings, and lists.
- Variables store and label values that can be of different data types. Variables are created using names.
- Operators like arithmetic, comparison, and logical operators are used to manipulate values.
- User input and output is handled through functions like print() and input().
- Comments, indentation, and quotation are syntax elements in Python code.
C++ was created in the 1980s by Bjarne Stroustrup as an extension of the C language with object-oriented features. It combined features from C and Simula 67. The document provides an overview of the basic building blocks of C++ programs including characters, tokens, keywords, identifiers, literals, punctuators, operators, comments, streams, variables, and common errors. It describes the different data types and rules for writing identifiers, literals, and comments. It also explains common tokens like keywords, operators, and punctuators and how they are used in C++.
This document provides an overview of the C programming language. It discusses that C was developed in 1972 at Bell Labs and is a popular systems and applications programming language. The document then covers various C language concepts like data types, variables, operators, input/output functions, and provides examples of basic C programs and code snippets.
The document outlines topics to be covered in a C programming course, including structure of C programs, identifiers, data types, constants, variables, expressions, and operators. It provides details on each topic in 3 sentences or less:
The structure of a C program consists of functions, with one function called main executing first. Functions contain a heading, argument declarations, and a compound statement enclosed in braces. Compound statements can be nested and expressions must end with semicolons.
Python and Perl are both high-level programming languages. Python is an interpreted language with clear, readable syntax and intuitive object orientation. Perl is also an interpreted and dynamic language that supports both procedural and object-oriented programming and is best known for powerful text processing. Both languages have a long history and are widely used for web development, scientific computing, and other tasks.
Introduction- e - waste – definition - sources of e-waste– hazardous substances in e-waste - effects of e-waste on environment and human health- need for e-waste management– e-waste handling rules - waste minimization techniques for managing e-waste – recycling of e-waste - disposal treatment methods of e- waste – mechanism of extraction of precious metal from leaching solution-global Scenario of E-waste – E-waste in India- case studies.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
A review on techniques and modelling methodologies used for checking electrom...nooriasukmaningtyas
The proper function of the integrated circuit (IC) in an inhibiting electromagnetic environment has always been a serious concern throughout the decades of revolution in the world of electronics, from disjunct devices to today’s integrated circuit technology, where billions of transistors are combined on a single chip. The automotive industry and smart vehicles in particular, are confronting design issues such as being prone to electromagnetic interference (EMI). Electronic control devices calculate incorrect outputs because of EMI and sensors give misleading values which can prove fatal in case of automotives. In this paper, the authors have non exhaustively tried to review research work concerned with the investigation of EMI in ICs and prediction of this EMI using various modelling methodologies and measurement setups.
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSIJNSA Journal
The smart irrigation system represents an innovative approach to optimize water usage in agricultural and landscaping practices. The integration of cutting-edge technologies, including sensors, actuators, and data analysis, empowers this system to provide accurate monitoring and control of irrigation processes by leveraging real-time environmental conditions. The main objective of a smart irrigation system is to optimize water efficiency, minimize expenses, and foster the adoption of sustainable water management methods. This paper conducts a systematic risk assessment by exploring the key components/assets and their functionalities in the smart irrigation system. The crucial role of sensors in gathering data on soil moisture, weather patterns, and plant well-being is emphasized in this system. These sensors enable intelligent decision-making in irrigation scheduling and water distribution, leading to enhanced water efficiency and sustainable water management practices. Actuators enable automated control of irrigation devices, ensuring precise and targeted water delivery to plants. Additionally, the paper addresses the potential threat and vulnerabilities associated with smart irrigation systems. It discusses limitations of the system, such as power constraints and computational capabilities, and calculates the potential security risks. The paper suggests possible risk treatment methods for effective secure system operation. In conclusion, the paper emphasizes the significant benefits of implementing smart irrigation systems, including improved water conservation, increased crop yield, and reduced environmental impact. Additionally, based on the security analysis conducted, the paper recommends the implementation of countermeasures and security approaches to address vulnerabilities and ensure the integrity and reliability of the system. By incorporating these measures, smart irrigation technology can revolutionize water management practices in agriculture, promoting sustainability, resource efficiency, and safeguarding against potential security threats.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...IJECEIAES
Climate change's impact on the planet forced the United Nations and governments to promote green energies and electric transportation. The deployments of photovoltaic (PV) and electric vehicle (EV) systems gained stronger momentum due to their numerous advantages over fossil fuel types. The advantages go beyond sustainability to reach financial support and stability. The work in this paper introduces the hybrid system between PV and EV to support industrial and commercial plants. This paper covers the theoretical framework of the proposed hybrid system including the required equation to complete the cost analysis when PV and EV are present. In addition, the proposed design diagram which sets the priorities and requirements of the system is presented. The proposed approach allows setup to advance their power stability, especially during power outages. The presented information supports researchers and plant owners to complete the necessary analysis while promoting the deployment of clean energy. The result of a case study that represents a dairy milk farmer supports the theoretical works and highlights its advanced benefits to existing plants. The short return on investment of the proposed approach supports the paper's novelty approach for the sustainable electrical system. In addition, the proposed system allows for an isolated power setup without the need for a transmission line which enhances the safety of the electrical network
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsVictor Morales
K8sGPT is a tool that analyzes and diagnoses Kubernetes clusters. This presentation was used to share the requirements and dependencies to deploy K8sGPT in a local environment.
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
ACEP Magazine edition 4th launched on 05.06.2024Rahul
This document provides information about the third edition of the magazine "Sthapatya" published by the Association of Civil Engineers (Practicing) Aurangabad. It includes messages from current and past presidents of ACEP, memories and photos from past ACEP events, information on life time achievement awards given by ACEP, and a technical article on concrete maintenance, repairs and strengthening. The document highlights activities of ACEP and provides a technical educational article for members.
2. Python is a high-level, interpreted and
general-purpose dynamic programming
language that focuses on code readability. The
syntax in Python helps the programmers to do
coding in fewer steps as compared to Java or
C++.
Let us learn the basic elements of python
programming
3.
4. What is Character Set?
Character set is a bunch of
identifying elements in the
programming language.
5.
6. PYTHON
CHARACTER
SET
•Letters:- A-Z, a-z
•Digits:- 0 to 9
•Special Symbols:- space + - / ( ) [ ] = ! = < > , ‘ “ $ #
; : ? &
•White Spaces:- Blank Space , Horizontal Tab, Vertical
tab, Carriage Return.
•Other Characters:- Python can process all 256 ASCII
and Unicode Characters.
12. What is Keyword?
Keywords are also called as
reserved words these are having
special meaning in python
language. The words are defined
in the python interpreter hence
these cant be used as programming
identifiers.
1. Keyword/Reserved Word
15. What is an identifier?
A Python Identifier is a name
given to a function, class, variable,
module, or other objects that you’ll
be using in your Python program.
In short, its a name appeared in
the program.
For example: a, b, c
a b and c are the identifiers and
a b & c and , are the tokens
17. What are the python naming
conventions?
1. An identifier can be a
combination of uppercase letters,
lowercase letters, underscores, and
digits (0-9). Hence, the following
are valid identifiers: myClass,
my_variable, var_1, and
print_hello_world.
18. What are the python naming
conventions?
2. The first character must be letter.
3. Special characters such as %, @,
and $ are not allowed within
identifiers.
4. An identifier should not begin
with a number. Hence, 2variable is
not valid, but variable2 is
19. What are the python naming
conventions?
5. Python is a case-sensitive
language and this behaviour
extends to identifiers. Thus,
Labour and labour are two distinct
identifiers in Python.
6. You cannot use Python keywords
as identifiers.
PYTHON NAMING CONVENTIONS
20. What are the python naming
conventions?
7. You cannot use Python keywords
as identifiers.
8. You can use underscores to
separate multiple words in
your identifier.
PYTHON NAMING CONVENTIONS
21. SOME VALID IDENTIFIERS:
Myfile1 DATE9_7_8
y3m9d3 _xs
MYFILE _FXd
SOME INVALID IDENTIFIERS:
MY-REC 28dre break
elif false del
23. What is literals?
Literals are also called as
constants or constant values these
are the values which never change
during the execution of program.
25. What are the types of literals?
1) String Literals or Constants.
2) Numeric Literals or
Constants.
3) Boolean Literals or
Constants.
4) Special Literal None.
5) Literal Collections.
27. What is string?
Sequence of letters enclosed in
quotes is called string or string
literal or constant.
Python supports both form
of quotes i.e.
‘Hello’
“Hello”
28.
29. >>> s = “Hello Python”
This is how Python would index the string:
Forward Indexing
Backward Indexing
30. To access the first character on the
string you just created, type and enter the
variable name s and the index 0 within
square brackets like this:
>>>s[0]
You’ll get this output:
‘H’
31. To access the last character, you can use
this expression:
>>>s[len(s)-1]
You’ll get the output:
‘n’
Len()
function is
used to find
the length of
the string.
32. The expression introduces you to the len
function. There is actually an easier way to
access the last item on the string:
>>>s[-1]
‘n’
To access the penultimate character:
>>>s[-2]
‘o’
33. What are the types of strings
supported in python?
Python supports two ways of
representation of strings:
1) Single Line Strings.
2) Multi Line Strings.
34.
35. Strings created using single
quote or double quote must end in
one line are called single line
strings
For Example:
Item=“Computer”
Or
Item= ‘Computer’
36. Strings created using single
quote or double quote and spread
across multiple lines are called
Multi Line Strings.
by adding backslash one can
continue to type on next line.
For instance: Item = ‘Key
board’
37.
38. ‘’ Size is 1 ( is an
escape
sequence)
‘abc’ size is 3
“ab” size is 2
“Raama’s Laptop” size is 13
39.
40. For multi line strings created by
triple quotes, while calculating
size, the EOL(End of Line)
character at the end of line is also
counted.
For instance:
Str2=“’x
y
Enter keys are
considered as
EOL so size of
str2 is 5
63. Binary literals (base 2): To signify binary
literals, you’ll use the prefix ‘0B’ or ‘0b’
(zero and uppercase or lowercase ‘b’).
64.
65. To convert an integer into its string
representation, you can use the functions
hex(), bin(), and oct().
To convert the integer 7 to its octal literal,
type and enter oct(7) on the command
prompt. You’ll get the output ‘0o7’:
66. Here is what happens when you convert the
integer 2572 to a hexadecimal literal:
67. see what happens when you use the bin()
function to convert the integer 12 to its
binary string:
68.
69. Floating point literals are also
called as real literals having fractional
part.
These may be written in one of the two
forms:
1. Fractional Form: for example 15.75
2. Exponent Form: It consists of two parts
Mantissa and Exponent. for example 5.8
can be represented as 0.58 x 10-1 =
72. A Boolean literal in python is
used to represent the Boolean values
(true or false).
73.
74. The None literal is used to
indicate absence of value.
For example: val = None
75.
76. Python supports literal
collections also such as tuple and lists
..etc
It will be to complex to discuss as we
are in the beginning, subsequent
chapters we will cover literal collections.
77.
78. What is an operator?
Operators are tokens that trigger some
computation when applied to a variable.
In detail we study in the next chapter.
79.
80. Punctuators are also called as separators
The Followings are used as punctuators:
Brackets [ ]
Parentheses ( )
Braces { }
Comma ,
Semicolon ;
Colon :
Asterisk *
Ellipsis …
Equal Sign =
Pound Sign #
81.
82. • Use consistent indentation instead.
• The first line with less indentation
is outside of the block.
• The first line with more indentation
starts a nested block.
• Often a colon appears at the start of
a new block. (E.g. for function and
class definitions.).
83.
84. Comments are non
executable statements in a program.
Single line comment always starts
with #
Multiline comment will be in
triple quotes. For example “’ write a
program to find the simple interest “’.
Note: Triple apostrophe is called
docstrings.
85.
86. In computer terminology
statement refers to an instruction.
Program contains several
statements. A collection of
statements makes program
Another name for a program is
code.
87.
88. What is function?
Function is a self contained
program segment which carries out
some specific well defined task.
For Example:
def sqr( num ):
result= num *num
print ("Square = "
, result)
sqr()
89.
90. Statement Termination: python
does not use any symbol to
terminate the statement.
Maximum Line Length: Line Length
be maximum 79 characters.
Whitespaces: you should always
have whitespace around operators
but not with parenthesis.
91. Block or Code Block: A group of
statements which are part of another
statement or function is called
Block or Code Block.
Case Sensitive: Python is case
sensitive.
92.
93. Named labels are called variables.
For example:marks =86
78 79 80 81 82 83 84 85 86 87
2000 2016 2018 2026 2032 2044 2048 2050 2054 2068
marks refers
to location
2054
94. Now marks = 81
78 79 80 81 82 83 84 85 86 87
2000 2016 2018 2026 2032 2044 2048 2050 2054 2068
marks refers
to location
2026
Note: Variables in python do not have
fixed locations unlike other programming
95. lvalues & rvalues:
Lvalue: Expressions that is on LHS
(Left Hand Side) is called Lvalue.
Rvalue: Expressions that is on RHS
(Right Hand Side) is called Rvalue.
96. Multiple Assignments
Python is very versatile with
assignment statements.
1. Assigning same value to multiple
variables:
a=b=c=d=e=10
97. Multiple Assignments
2. Assigning Multiple values to
multiple variables:
p,q,r =5,10,15
print(q, r) will print 10 15
p,q=q,p
print (p,q) will print 10 5
100. Dynamic Typing:
A variable pointing to a value of
certain type can be made to point to a
value/object of different type this is
called Dynamic Typing.
x=10
print(x)
x=“ Hello World”
print(x)
102. Caution with Dynamic Typing:
x = ‘day’
y = x/2 Error! String can not be divided.
103. type() function:
To know the data type of a value which is
pointing use type ( )
>>>a=10
>>>type(a)
<class ‘int’>
>>>a=20.4
>>>type(a)
<class ‘float’>
Type returned as integer
Type returned as float
104. type() function:
To know the data type of a value which is
pointing use type ( )
>>>a=“Hello”
>>>type(a)
<class ‘str’> Type returned as string
105.
106. Input( ) Function is a built in function
of python used to read values from the
user
The general format or syntax of the input()
is:
Variable_to_hold_the_value=input(message
)
For Example:
Where,
variable_to_Hold_the_Value is a variable
107. For Example:
p = input(“Enter the value”)
x = int(input(“Enter x value”))
reads the value and converts it in to integer
type
data or value.
y=float(input(“Enter y value”))
reads the value and converts it in to float
type
108. int ( ) and float ( ) Functions:
Python offers two functions to be used
with input( ) to convert the received
values:
Example 1: >>age = int(input(“Enter age”))
Example 2: >>sal=float(input(“Enter salary))
109.
110. print( ) Function is a built in function
of python used to display the values on
the screen
The general format or syntax of the input()
is:
print(*objects, sep=' ', end='n',
file=sys.stdout, flush=False)
The print function can print an arbitrary
number of values ("value1, value2, ..."), which
are separated by commas. These values are
separated by blanks. In the following
example we can see two print calls. We are
printing two values in both cases, i.e. a string
111. print() Parameters:
objects - object to the printed. * indicates
that there may be more than one object
sep - objects are separated by sep. Default
value: ' ‘ end - end is printed at last
file - must be an object with write(string)
method. If omitted it, sys.stdout will be
used which prints objects on the screen.
flush - If True, the stream is forcibly
flushed. Default value: False
112. print("Python is fun.")
a = 5
#Two objects are passed:
print("a =", a)
b = a
# Three objects are passed:
print('a =', a, '= b‘)
Output
Python is fun.
a = 5
a = 5 = b
Example 1: How print() works in Python?
113. >>> print("a = ", a)
a = 3.564
>>> print("a = n", a)
a =
3.564
>>>
Example 2: How print() works in Python?
114.
115.
116. Each carries 2 Marks Questions (10 x 2
= 20)
1. What is EOL?
2. What is an escape sequence?
3. What is the maximum line length in a
python program?
4. Write any four keywords of python
language
5. What are the types of Assignment
statements? Explain
6. Explain with a diagram how a
variable refers to a memory location?
117. Each carries 2 Marks Questions (10 x 2
= 20)
7. What is Dynamic typing?
8. Write any four python naming
conventions
9. What is input ( ) function? Write
down the general format of input ( )
function and explain with proper example.
10. What is print ( ) function? Write down
the general format of print ( ) function and
explain with proper example.
***
119. 1. What is character set?
2. What is token?
3. List the types of tokens
4. What is keyword?
5. What is an identifier? Give suitable example.
6. What is a literal?
7. What is string?
8. What is single line string?
9. What is multi line string?
10. What is EOL?
11. What is an escape sequence?
12. What is Boolean literal?
CHAPTER 2: PYTHON FUNDAMENTALS
One Mark Questions
120. 13. What is none?
14. What is an operator?
15. What is Unary Operator?
16. What is Binary Operator?
17. List the shift operators
18. List the Bitwise operators
19. What is an assignment statement?
20. What is Punctuators?
21. What is comment?
22. What is whitespace?
23. What is statement?
CHAPTER 2: PYTHON FUNDAMENTALS
One Mark Questions
121. 24. Weather python uses statement
termination? Justify your answer
25. What is the maximum line length in a
python program?
26. What is Block?
27. What is Code Block?
28. What is Code?
29. What do you mean by case sensitive
language?
CHAPTER 2: PYTHON FUNDAMENTALS
One Mark Questions
122. 30. What is variable?
31. What is Lvalue?
32. What is Rvalue?
33. What is an Assignment statement?
34. What is Dynamic typing?
CHAPTER 2: PYTHON FUNDAMENTALS
One Mark Questions
123. CHAPTER 2: PYTHON FUNDAMENTALS
Two Marks Questions
1. Explain the character set of python
2. What are the types of tokens supported in
python language?
3. Write any four keywords of python language
4. What are the types of literals?
5. Explain Boolean literals
6. What are relational operators?
7. What are the types of Assignment
statements? Explain
8. What is General Structure or General format
or Syntax?
124. CHAPTER 2: PYTHON FUNDAMENTALS
Two Marks Questions
9. What are the types of comments? Explain
with suitable examples
10. Explain with a diagram how a variable refers
to a memory location?
11. While dealing with dynamic typing what
caution must be taken care of? Explain with
suitable example.
125. CHAPTER 2: PYTHON FUNDAMENTALS
Three Marks Questions
1. What are the python naming
conventions?
2. Explain the representation of string in
python language.
3. Explain the types of strings supported by
python language.
4. Explain escape sequences.
5. Explain numerical literals supported in
python language.
6. Explain the Floating point literals
supported in python language.
126. CHAPTER 2: PYTHON FUNDAMENTALS
Three Marks Questions
7. Explain the General structure of python
program and give example.
8. What is whitespace how its useful in
python programming?
9. What is input ( ) function? Write down
the general format of input ( ) function and
explain with proper example.
10. What is print ( ) function? Write down
the general format of print ( ) function and
explain with proper example.