I am aPracticing Civil Engineer with over 3 years of experience in
Designmen Consulting Engineers. Possesses expertise in
Structural design, Building Information Modelling, Project
management, and Project coordination. My expertise lies in the
analysis and design of reinforced concrete and steel structures. I
have a keen interest in integrating Building Information
Modeling with structural design, conducting seismic evaluations
of structures, performing finite element analysis, and exploring
innovative construction materials. Demonstrated success in
managing projects for renowned clients like Aga Khan Education
Services, NUML, Helping Hand, and Iqra University.
3.
VISION FOR THEFUTURE
Python has emerged as a powerful tool in the field of structural
engineering, enabling engineers to streamline their workflows,
automate repetitive tasks, and leverage advanced data analysis
capabilities. This presentation will explore the benefits and
practical applications of Python in structural analysis and design.
My vision for the presentation is to introduce structural engineers
to the Python programming language, starting from the basic
concepts and leading them through to more advanced topics. The
aim is to familiarize engineers with Python so they can leverage
its powerful features in their work.
4.
The lectures aredivided into three sections: Python Basics,
Intermediate, and Advanced. In this presentation, I will
discuss the fundamental concepts of Python, which include
Data Types, Functions, and Operators.
5.
DATA TYPES
• InPython, data types are the classification or categorization of
data items.
• They represent the kind of value that tells what operations can
be performed on a particular data.
• Data types are used to define the type of a variable, specifying
what type of data we are going to store in a variable.
Python has the following basic built-in data types:
• Text Type
• Numeric Type
• Boolean
6.
TEXT TYPE
• String:This is used for a sequence of characters, text or
strings.
• str is short of string.
• Note: Always write in single or double Quotation Mark (“”)
• Example:
“Hassan”
7.
NUMERIC TYPE
Integer: Itcontains positive or negative whole numbers
(without fraction or decimal).
int is short of integer.
Float: This is a number that contains a decimal point.
FUNCTION
• A functionis a block of code that performs a specific task.
• Function Call: To execute the code inside the function, you need to
call the function.
• This is done by using the function name followed by parentheses.
For example,
function()
Types of function:
• Print function
• Input function
• Type function
10.
PRINT FUNCTION ()
•The print() function in Python outputs the specified
message to the screen. The message can be a string, or any
other object, the object will be converted into a string before
written to the screen.
Example:
11.
In Python, f-strings,also known as formatted string literals, provide a
concise and convenient way to embed expressions inside string literals
for formatting.
When to execute two datatypes in a function, ‘f’ function and {} is used.
In the example above, name and age are variables of different data
types (str and int, respectively.
12.
INPUT FUNCTION ()
•The input() function in Python is a built-in function that
allows for user input.
• It presents a prompt to the user (the optional argument),
waits for the user to enter some text, and then returns the
text the user entered.
• Here’s the syntax of the input() function:
Input(prompt)
13.
The n characterin Python is known as the newline character or line
break. It’s used to start a new line in the output of the string.
14.
TYPE FUNCTION ()
•The type() function in Python is a built-in function that
returns the type of the specified object.
• It’s mostly used for debugging purposes.
• Syntax
type(object, bases, dict)
15.
OPERATORS
• In Python,operators are special symbols, combinations of
symbols, or keywords that designate some type of
computation.
• They are used to perform operations on variables and
values
Types of Operators
• Arithmetic Operator
• Assignment Operator
• Comparison Operator
16.
ARITHMETIC OPERATORS:
• Theseare used with numeric values to perform common
mathematical operations, such as addition (+), subtraction
(-), multiplication (*), division (/), modulus (%),
exponentiation (**), and floor division (//).
17.
ASSIGNMENT OPERATORS
• Theseare used to assign values to variables, such as equals
(=), plus equals (+=), minus equals (-=), times equals (*=),
divided by equals (/=), modulus equals (%=), floor division
equals (//=), exponent equals (**=), and others.
18.
COMPARISON OPERATORS
• Theseare used to compare two values, such as equal to (==),
not equal to (!=), greater than (>), less than (<), greater than
or equal to (>=), and less than or equal to (<=).
19.
REMEMBER
In Python, the# symbol is used to start a comment. A comment is a
line of text that Python won’t try to run as code. It’s just for humans
to read.
Comments can be used to explain Python code, make the code more
readable, or prevent execution when testing code.