Introduction to Python and Basic Syntax
Understand the basics of Python programming.
Set up the Python environment.
Write simple Python scripts
Python is a high-level, interpreted programming language known for its readability and versatility(easy to read and easy to use). It can be used for a wide range of applications, from web development to scientific computing
Kosmik is the best institute for Python training in Hyderabad Kukatpally/KPHB. kosmik provides lab facilities with complete real-time training with live sessions
call now: +91-8712186898, +91-8179496603, +91-6309565721
This file contains the first steps any beginner can take as he/she starts a journey into the rich and beautiful world of Python programming. From basics such as variables to data types and recursions, this document touches briefly on these concepts. It is not, by any means, an exhaustive guide to learn Python, but it serves as a good starting point and motivation.
This document provides information about the Python programming language. It discusses the features of Python, including that it is object-oriented, open source, portable, powerful, and easy to learn. It also covers Python syntax, statements, functions, modules, exception handling, and how to run Python programs. The outcomes of learning these Python concepts are also listed.
This document provides an overview of the Python programming language. It discusses Python's history, features, and why it is a good programming language. Key points covered include:
- Python was created in the late 1980s and draws from many other languages.
- It is an open source, interpreted, object-oriented, and portable language with a large online community and library support.
- Python code is compiled to bytecode for performance. It has dynamic typing, automatic memory management, and is powerful yet easy to learn.
- The document reviews Python statements, expressions, variables, basic data types, functions, modules and exceptions. It provides examples of Python code.
Chapter 1 Class 12 Computer Science Unit 1ssusera7a08a
The document discusses the basics of Python programming language. It provides an introduction to Python, describing how it is an interpreted, high-level and general-purpose programming language. It then covers Python features, data types, operators, and how to work in both interactive and script modes in Python. The document also discusses topics like variables, data handling, arithmetic operators, comparison operators, and more with examples.
Data Structure and Algorithms (DSA) with Pythonepsilonice
This is the summer internship report. This report is the approved 'sample' outline for a summer internship mandatory submission. Titled, "Data Structure with Algorithms with Python".
The document discusses Python programming language. It provides an introduction to Python, describing it as an interpreted, high-level and general-purpose programming language. It then covers various data types in Python including numbers, strings, booleans, lists, tuples, sets and dictionaries. The document also discusses operators in Python like arithmetic, comparison, logical and bitwise operators. Finally, it explains how to work with Python in both interactive and script modes.
Python is an object-oriented programming language created by Guido Rossum in 1989. It is ideally designed for rapid prototyping of complex applications. It has interfaces to many OS system calls and libraries and is extensible to C or C++. Many large companies use the Python programming language, including NASA, Google, YouTube, BitTorrent, etc.
Python is a general purpose programming language that can be used for both programming and scripting. It is an interpreted language, meaning code is executed line by line by the Python interpreter. Python code is written in plain text files with a .py extension. Key features of Python include being object-oriented, using indentation for code blocks rather than brackets, and having a large standard library. Python code can be used for tasks like system scripting, web development, data analysis, and more.
unit (1)INTRODUCTION TO PYTHON course.pptxusvirat1805
This document provides an introduction to the Python programming language. It discusses what Python is, its history and features. It describes common uses of Python in industries like CIA, Google, Facebook, NASA. It also covers Python building blocks like identifiers, variables, keywords. Additionally, it explains Python data types like numeric, strings, lists, tuples and dictionaries. Finally, it discusses taking input in Python and type casting.
The document provides an overview of a hands-on workshop on the Python programming language conducted by Abdul Haseeb for a faculty development program. The workshop covers the basics of Python including its history, design philosophy, why it is popular, how to get started with the Python IDE, basic data types, variables, operators, input/output functions, and differences between Python versions 2 and 3. Examples are provided to demonstrate various Python concepts like strings, integers, floats, lists, tuples, dictionaries, functions to convert between types, and string operations. Comparisons between Python and C/C++ highlight differences in syntax, commenting, error handling and code readability.
This document provides an overview of a C programming lesson that covers various topics including printing text, data types, the sizeof operator, GCC parameters, coding style, standard library headers, and return values from the main function. It contains slides on C programming fundamentals, learning objectives, quiz questions, and a link to additional slides. The hands-on lab practice section allows the learner to put the concepts into practice.
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...DRVaibhavmeshram1
Python
Language
is uesd in engineeringStory adapted from Stephen Covey (2004) “The Seven Habits of Highly Effective People” Simon & Schuster).
“Management is doing things right, leadership is doing the right things”
(Warren Bennis and Peter Drucker)
Story adapted from Stephen Covey (2004) “The Seven Habits of Highly Effective People” Simon & Schuster).
“Management is doing things right, leadership is doing the right things”
(Warren Bennis and Peter Drucker)
Story adapted from Stephen Covey (2004) “The Seven Habits of Highly Effective People” Simon & Schuster).
“Management is doing things right, leadership is doing the right things”
(Warren Bennis and Peter Drucker)
The Sponsor:
Champion and advocates for the change at their level in the organization.
A Sponsor is the person who won’t let the change initiative die from lack of attention, and is willing to use their political capital to make the change happen
The Role model:
Behaviors and attitudes demonstrated by them are looked upon by everyone else. . Hence, they must be willing to go first.
Employees watch leaders for consistency between words and actions to see if they should believe the change is really going to happen.
The decision maker:
Leaders usually control resources such as people, budgets, and equipment, and thus have the authority to make decisions (as per their span of control) that affect the initiative.
During change, leaders must leverage their decision-making authority and choose the options that will support the initiative.
The Decision-Maker is decisive and sets priorities that support change.
The Sponsor:
Champion and advocates for the change at their level in the organization.
A Sponsor is the person who won’t let the change initiative die from lack of attention, and is willing to use their political capital to make the change happen
The Role model:
Behaviors and attitudes demonstrated by them are looked upon by everyone else. . Hence, they must be willing to go first.
Employees watch leaders for consistency between words and actions to see if they should believe the change is really going to happen.
The decision maker:
Leaders usually control resources such as people, budgets, and equipment, and thus have the authority to make decisions (as per their span of control) that affect the initiative.
During change, leaders must leverage their decision-making authority and choose the options that will support the initiative.
The Decision-Maker is decisive and sets priorities that support change.
The Sponsor:
Champion and advocates for the change at their level in the organization.
A Sponsor is the person who won’t let the change initiative die from lack of attention, and is willing to use their political capital to make the change happen
The Role model:
Behaviors and attitudes demonstrated by them are looked upon by everyone else. . Hence, they must be willing to go first.
Employees watch leaders for consistency between words and actions to see if they s
This document provides an introduction to basic Python programming through examples. It covers installing Python, using Python interactively for calculations, writing Python scripts, using variables, mathematical functions, user input, loops, conditional statements, tuples, and lists. The key topics are explained over 14 sections with code examples to demonstrate each concept.
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON Nandakumar P
Unit 1 : INTRODUCTION TO PROBLEM SOLVING, EXPRESSION AND DATA TYPES
Fundamentals: what is computer science - Computer Algorithms - Computer Hardware - Computer software - Computational problem solving using the Python programming language - Overview of Python, Environmental Setup, First program in Python, Python I/O Statement. Expressions and Data Types: Literals, Identifiers and Variables, Operators, Expressions. Data types, Numbers, Type Conversion, Random Number.
Problem solving: Restaurant Tab calculation and Age in seconds.
Introduction to Python Programming | InsideAIMLVijaySharma802
This document provides an introduction to the Python programming language. It discusses key features such as: Python being an easy to learn, read, and maintain language with a broad standard library; its use across many domains and companies; and how it can be used for tasks like web development, data science, and more. The document also covers Python concepts like variables, data types, conditional statements, loops, functions, strings and operators.
Python is an interpreted, object-oriented programming language created in the early 1990s by Guido van Rossum. It has an interactive mode for testing code. Python code is portable to most systems and extensible via modules written in C/C++. Key features include functions, classes, conditional statements like if/else, loops like while and for, built-in data types like lists and dictionaries, and exception handling with try/except blocks. Variables in Python have function scope unless declared global, and indentation is used to group blocks of code instead of curly braces.
Python is an interpreted, object-oriented programming language created in the early 1990s by Guido van Rossum. It has an interactive mode for testing code. Python code is portable across many systems and extensible via modules written in C/C++. Key features include functions, classes, conditional statements like if/else, loops like while and for, built-in data types like lists and dictionaries, and exception handling with try/except blocks. Variables in Python have function scope unless declared global, and indentation is used to group blocks of code instead of curly braces.
This document provides an overview of Python basics training. It covers installing Python, running Python code through various methods like the command line, IDLE, and Jupyter notebooks. It also discusses Python syntax, variables, data types, operators, conditional statements, and loops. Key Python data types include integers, floats, strings, lists, and dictionaries. The document is intended as an introduction to Python for beginners.
The document provides an overview of the Python programming language, its applications, and key concepts. It discusses how Python is a versatile, high-level language suitable for web development, data science, scripting, scientific computing, and more. The document then covers Python's syntax, data types, operators, functions, modules, file handling capabilities, and compares Python to other languages like Java and C. It also provides examples of common Python programming concepts like lists, dictionaries, functions, classes and exceptions.
Introduction to python & its applications.pptPradeepNB2
Python is an interpreted, object-oriented programming language created in the 1990s. It has an interactive environment for testing code. Python code is written in plain text files and executed line by line. It supports common programming constructs like functions, conditionals, loops, lists, dictionaries, and more. The syntax is designed to be simpler than languages like C/C++. Python code is portable across many operating systems.
David Boutry - Specializes In AWS, Microservices And PythonDavid Boutry
With over eight years of experience, David Boutry specializes in AWS, microservices, and Python. As a Senior Software Engineer in New York, he spearheaded initiatives that reduced data processing times by 40%. His prior work in Seattle focused on optimizing e-commerce platforms, leading to a 25% sales increase. David is committed to mentoring junior developers and supporting nonprofit organizations through coding workshops and software development.
Ad
More Related Content
Similar to Introduction to Python Programming – Part I.pptx (20)
Data Structure and Algorithms (DSA) with Pythonepsilonice
This is the summer internship report. This report is the approved 'sample' outline for a summer internship mandatory submission. Titled, "Data Structure with Algorithms with Python".
The document discusses Python programming language. It provides an introduction to Python, describing it as an interpreted, high-level and general-purpose programming language. It then covers various data types in Python including numbers, strings, booleans, lists, tuples, sets and dictionaries. The document also discusses operators in Python like arithmetic, comparison, logical and bitwise operators. Finally, it explains how to work with Python in both interactive and script modes.
Python is an object-oriented programming language created by Guido Rossum in 1989. It is ideally designed for rapid prototyping of complex applications. It has interfaces to many OS system calls and libraries and is extensible to C or C++. Many large companies use the Python programming language, including NASA, Google, YouTube, BitTorrent, etc.
Python is a general purpose programming language that can be used for both programming and scripting. It is an interpreted language, meaning code is executed line by line by the Python interpreter. Python code is written in plain text files with a .py extension. Key features of Python include being object-oriented, using indentation for code blocks rather than brackets, and having a large standard library. Python code can be used for tasks like system scripting, web development, data analysis, and more.
unit (1)INTRODUCTION TO PYTHON course.pptxusvirat1805
This document provides an introduction to the Python programming language. It discusses what Python is, its history and features. It describes common uses of Python in industries like CIA, Google, Facebook, NASA. It also covers Python building blocks like identifiers, variables, keywords. Additionally, it explains Python data types like numeric, strings, lists, tuples and dictionaries. Finally, it discusses taking input in Python and type casting.
The document provides an overview of a hands-on workshop on the Python programming language conducted by Abdul Haseeb for a faculty development program. The workshop covers the basics of Python including its history, design philosophy, why it is popular, how to get started with the Python IDE, basic data types, variables, operators, input/output functions, and differences between Python versions 2 and 3. Examples are provided to demonstrate various Python concepts like strings, integers, floats, lists, tuples, dictionaries, functions to convert between types, and string operations. Comparisons between Python and C/C++ highlight differences in syntax, commenting, error handling and code readability.
This document provides an overview of a C programming lesson that covers various topics including printing text, data types, the sizeof operator, GCC parameters, coding style, standard library headers, and return values from the main function. It contains slides on C programming fundamentals, learning objectives, quiz questions, and a link to additional slides. The hands-on lab practice section allows the learner to put the concepts into practice.
Introduction to Python 01-08-2023.pon by everyone else. . Hence, they must be...DRVaibhavmeshram1
Python
Language
is uesd in engineeringStory adapted from Stephen Covey (2004) “The Seven Habits of Highly Effective People” Simon & Schuster).
“Management is doing things right, leadership is doing the right things”
(Warren Bennis and Peter Drucker)
Story adapted from Stephen Covey (2004) “The Seven Habits of Highly Effective People” Simon & Schuster).
“Management is doing things right, leadership is doing the right things”
(Warren Bennis and Peter Drucker)
Story adapted from Stephen Covey (2004) “The Seven Habits of Highly Effective People” Simon & Schuster).
“Management is doing things right, leadership is doing the right things”
(Warren Bennis and Peter Drucker)
The Sponsor:
Champion and advocates for the change at their level in the organization.
A Sponsor is the person who won’t let the change initiative die from lack of attention, and is willing to use their political capital to make the change happen
The Role model:
Behaviors and attitudes demonstrated by them are looked upon by everyone else. . Hence, they must be willing to go first.
Employees watch leaders for consistency between words and actions to see if they should believe the change is really going to happen.
The decision maker:
Leaders usually control resources such as people, budgets, and equipment, and thus have the authority to make decisions (as per their span of control) that affect the initiative.
During change, leaders must leverage their decision-making authority and choose the options that will support the initiative.
The Decision-Maker is decisive and sets priorities that support change.
The Sponsor:
Champion and advocates for the change at their level in the organization.
A Sponsor is the person who won’t let the change initiative die from lack of attention, and is willing to use their political capital to make the change happen
The Role model:
Behaviors and attitudes demonstrated by them are looked upon by everyone else. . Hence, they must be willing to go first.
Employees watch leaders for consistency between words and actions to see if they should believe the change is really going to happen.
The decision maker:
Leaders usually control resources such as people, budgets, and equipment, and thus have the authority to make decisions (as per their span of control) that affect the initiative.
During change, leaders must leverage their decision-making authority and choose the options that will support the initiative.
The Decision-Maker is decisive and sets priorities that support change.
The Sponsor:
Champion and advocates for the change at their level in the organization.
A Sponsor is the person who won’t let the change initiative die from lack of attention, and is willing to use their political capital to make the change happen
The Role model:
Behaviors and attitudes demonstrated by them are looked upon by everyone else. . Hence, they must be willing to go first.
Employees watch leaders for consistency between words and actions to see if they s
This document provides an introduction to basic Python programming through examples. It covers installing Python, using Python interactively for calculations, writing Python scripts, using variables, mathematical functions, user input, loops, conditional statements, tuples, and lists. The key topics are explained over 14 sections with code examples to demonstrate each concept.
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON Nandakumar P
Unit 1 : INTRODUCTION TO PROBLEM SOLVING, EXPRESSION AND DATA TYPES
Fundamentals: what is computer science - Computer Algorithms - Computer Hardware - Computer software - Computational problem solving using the Python programming language - Overview of Python, Environmental Setup, First program in Python, Python I/O Statement. Expressions and Data Types: Literals, Identifiers and Variables, Operators, Expressions. Data types, Numbers, Type Conversion, Random Number.
Problem solving: Restaurant Tab calculation and Age in seconds.
Introduction to Python Programming | InsideAIMLVijaySharma802
This document provides an introduction to the Python programming language. It discusses key features such as: Python being an easy to learn, read, and maintain language with a broad standard library; its use across many domains and companies; and how it can be used for tasks like web development, data science, and more. The document also covers Python concepts like variables, data types, conditional statements, loops, functions, strings and operators.
Python is an interpreted, object-oriented programming language created in the early 1990s by Guido van Rossum. It has an interactive mode for testing code. Python code is portable to most systems and extensible via modules written in C/C++. Key features include functions, classes, conditional statements like if/else, loops like while and for, built-in data types like lists and dictionaries, and exception handling with try/except blocks. Variables in Python have function scope unless declared global, and indentation is used to group blocks of code instead of curly braces.
Python is an interpreted, object-oriented programming language created in the early 1990s by Guido van Rossum. It has an interactive mode for testing code. Python code is portable across many systems and extensible via modules written in C/C++. Key features include functions, classes, conditional statements like if/else, loops like while and for, built-in data types like lists and dictionaries, and exception handling with try/except blocks. Variables in Python have function scope unless declared global, and indentation is used to group blocks of code instead of curly braces.
This document provides an overview of Python basics training. It covers installing Python, running Python code through various methods like the command line, IDLE, and Jupyter notebooks. It also discusses Python syntax, variables, data types, operators, conditional statements, and loops. Key Python data types include integers, floats, strings, lists, and dictionaries. The document is intended as an introduction to Python for beginners.
The document provides an overview of the Python programming language, its applications, and key concepts. It discusses how Python is a versatile, high-level language suitable for web development, data science, scripting, scientific computing, and more. The document then covers Python's syntax, data types, operators, functions, modules, file handling capabilities, and compares Python to other languages like Java and C. It also provides examples of common Python programming concepts like lists, dictionaries, functions, classes and exceptions.
Introduction to python & its applications.pptPradeepNB2
Python is an interpreted, object-oriented programming language created in the 1990s. It has an interactive environment for testing code. Python code is written in plain text files and executed line by line. It supports common programming constructs like functions, conditionals, loops, lists, dictionaries, and more. The syntax is designed to be simpler than languages like C/C++. Python code is portable across many operating systems.
David Boutry - Specializes In AWS, Microservices And PythonDavid Boutry
With over eight years of experience, David Boutry specializes in AWS, microservices, and Python. As a Senior Software Engineer in New York, he spearheaded initiatives that reduced data processing times by 40%. His prior work in Seattle focused on optimizing e-commerce platforms, leading to a 25% sales increase. David is committed to mentoring junior developers and supporting nonprofit organizations through coding workshops and software development.
In this paper, the cost and weight of the reinforcement concrete cantilever retaining wall are optimized using Gases Brownian Motion Optimization Algorithm (GBMOA) which is based on the gas molecules motion. To investigate the optimization capability of the GBMOA, two objective functions of cost and weight are considered and verification is made using two available solutions for retaining wall design. Furthermore, the effect of wall geometries of retaining walls on their cost and weight is investigated using four different T-shape walls. Besides, sensitivity analyses for effects of backfill slope, stem height, surcharge, and backfill unit weight are carried out and of soil. Moreover, Rankine and Coulomb methods for lateral earth pressure calculation are used and results are compared. The GBMOA predictions are compared with those available in the literature. It has been shown that the use of GBMOA results in reducing significantly the cost and weight of retaining walls. In addition, the Coulomb lateral earth pressure can reduce the cost and weight of retaining walls.
Design of Variable Depth Single-Span Post.pdfKamel Farid
Hunched Single Span Bridge: -
(HSSBs) have maximum depth at ends and minimum depth at midspan.
Used for long-span river crossings or highway overpasses when:
Aesthetically pleasing shape is required or
Vertical clearance needs to be maximized
Optimization techniques can be divided to two groups: Traditional or numerical methods and methods based on stochastic. The essential problem of the traditional methods, that by searching the ideal variables are found for the point that differential reaches zero, is staying in local optimum points, can not solving the non-linear non-convex problems with lots of constraints and variables, and needs other complex mathematical operations such as derivative. In order to satisfy the aforementioned problems, the scientists become interested on meta-heuristic optimization techniques, those are classified into two essential kinds, which are single and population-based solutions. The method does not require unique knowledge to the problem. By general knowledge the optimal solution can be achieved. The optimization methods based on population can be divided into 4 classes from inspiration point of view and physical based optimization methods is one of them. Physical based optimization algorithm: that the physical rules are used for updating the solutions are:, Lighting Attachment Procedure Optimization (LAPO), Gravitational Search Algorithm (GSA) Water Evaporation Optimization Algorithm, Multi-Verse Optimizer (MVO), Galaxy-based Search Algorithm (GbSA), Small-World Optimization Algorithm (SWOA), Black Hole (BH) algorithm, Ray Optimization (RO) algorithm, Artificial Chemical Reaction Optimization Algorithm (ACROA), Central Force Optimization (CFO) and Charged System Search (CSS) are some of physical methods. In this paper physical and physic-chemical phenomena based optimization methods are discuss and compare with other optimization methods. Some examples of these methods are shown and results compared with other well known methods. The physical phenomena based methods are shown reasonable results.
AI-Powered Data Management and Governance in RetailIJDKP
Artificial intelligence (AI) is transforming the retail industry’s approach to data management and decisionmaking. This journal explores how AI-powered techniques enhance data governance in retail, ensuring data quality, security, and compliance in an era of big data and real-time analytics. We review the current landscape of AI adoption in retail, underscoring the need for robust data governance frameworks to handle the influx of data and support AI initiatives. Drawing on literature and industry examples, we examine established data governance frameworks and how AI technologies (such as machine learning and automation) are augmenting traditional data management practices. Key applications are identified, including AI-driven data quality improvement, automated metadata management, and intelligent data lineage tracking, illustrating how these innovations streamline operations and maintain data integrity. Ethical considerations including customer privacy, bias mitigation, transparency, and regulatory compliance are discussed to address the challenges of deploying AI in data governance responsibly.
OPTIMIZING DATA INTEROPERABILITY IN AGILE ORGANIZATIONS: INTEGRATING NONAKA’S...ijdmsjournal
Agile methodologies have transformed organizational management by prioritizing team autonomy and
iterative learning cycles. However, these approaches often lack structured mechanisms for knowledge
retention and interoperability, leading to fragmented decision-making, information silos, and strategic
misalignment. This study proposes an alternative approach to knowledge management in Agile
environments by integrating Ikujiro Nonaka and Hirotaka Takeuchi’s theory of knowledge creation—
specifically the concept of Ba, a shared space where knowledge is created and validated—with Jürgen
Habermas’s Theory of Communicative Action, which emphasizes deliberation as the foundation for trust
and legitimacy in organizational decision-making. To operationalize this integration, we propose the
Deliberative Permeability Metric (DPM), a diagnostic tool that evaluates knowledge flow and the
deliberative foundation of organizational decisions, and the Communicative Rationality Cycle (CRC), a
structured feedback model that extends the DPM, ensuring long-term adaptability and data governance.
This model was applied at Livelo, a Brazilian loyalty program company, demonstrating that structured
deliberation improves operational efficiency and reduces knowledge fragmentation. The findings indicate
that institutionalizing deliberative processes strengthens knowledge interoperability, fostering a more
resilient and adaptive approach to data governance in complex organizations.
Jacob Murphy Australia - Excels In Optimizing Software ApplicationsJacob Murphy Australia
In the world of technology, Jacob Murphy Australia stands out as a Junior Software Engineer with a passion for innovation. Holding a Bachelor of Science in Computer Science from Columbia University, Jacob's forte lies in software engineering and object-oriented programming. As a Freelance Software Engineer, he excels in optimizing software applications to deliver exceptional user experiences and operational efficiency. Jacob thrives in collaborative environments, actively engaging in design and code reviews to ensure top-notch solutions. With a diverse skill set encompassing Java, C++, Python, and Agile methodologies, Jacob is poised to be a valuable asset to any software development team.
The main purpose of the current study was to formulate an empirical expression for predicting the axial compression capacity and axial strain of concrete-filled plastic tubular specimens (CFPT) using the artificial neural network (ANN). A total of seventy-two experimental test data of CFPT and unconfined concrete were used for training, testing, and validating the ANN models. The ANN axial strength and strain predictions were compared with the experimental data and predictions from several existing strength models for fiber-reinforced polymer (FRP)-confined concrete. Five statistical indices were used to determine the performance of all models considered in the present study. The statistical evaluation showed that the ANN model was more effective and precise than the other models in predicting the compressive strength, with 2.8% AA error, and strain at peak stress, with 6.58% AA error, of concrete-filled plastic tube tested under axial compression load. Similar lower values were obtained for the NRMSE index.
This research presents the optimization techniques for reinforced concrete waffle slab design because the EC2 code cannot provide an efficient and optimum design. Waffle slab is mostly used where there is necessity to avoid column interfering the spaces or for a slab with large span or as an aesthetic purpose. Design optimization has been carried out here with MATLAB, using genetic algorithm. The objective function include the overall cost of reinforcement, concrete and formwork while the variables comprise of the depth of the rib including the topping thickness, rib width, and ribs spacing. The optimization constraints are the minimum and maximum areas of steel, flexural moment capacity, shear capacity and the geometry. The optimized cost and slab dimensions are obtained through genetic algorithm in MATLAB. The optimum steel ratio is 2.2% with minimum slab dimensions. The outcomes indicate that the design of reinforced concrete waffle slabs can be effectively carried out using the optimization process of genetic algorithm.
Welcome to MIND UP: a special presentation for Cloudvirga, a Stewart Title company. In this session, we’ll explore how you can “mind up” and unlock your potential by using generative AI chatbot tools at work.
Curious about the rise of AI chatbots? Unsure how to use them-or how to use them safely and effectively in your workplace? You’re not alone. This presentation will walk you through the practical benefits of generative AI chatbots, highlight best practices for safe and responsible use, and show how these tools can help boost your productivity, streamline tasks, and enhance your workday.
Whether you’re new to AI or looking to take your skills to the next level, you’ll find actionable insights to help you and your team make the most of these powerful tools-while keeping security, compliance, and employee well-being front and center.
2. Why Python?
Introduction to Internet of Things
2
Python is a versatile language which is easy to script and easy to
read.
It doesn’t support strict rules for syntax.
Its installation comes with integrated development environment
for programming.
It supports interfacing with wide ranging hardware platforms.
With open-source nature, it forms a strong backbone to build large
applications.
3. Python IDE
Introduction to Internet of Things
3
Python IDE is a free and open source software that is used to
write codes, integrate several modules and libraries.
It is available for installation into PC with Windows, Linux and
Mac.
Examples: Spyder, PyCharm, etc.
4. Starting with Python
Introduction to Internet of Things
4
Simple printing statement at the python interpreter prompt,
>>> print “Hi, Welcome to python!”
Output: Hi, Welcome to python!
To indicate different blocks of code, it follows rigid indentation.
if True:
print “Correct"
else:
print “Error"
5. Data-types in
Python
Introduction to Internet of Things
5
There are 5 data types in Python:
Numbers
x, y, z = 10, 10.2, " Python "
String
x = ‘This is Python’
print x
print x[0]
print x[2:4]
>>This is Python
>>T
>>is
7. Controlling
Statements
Introduction to Internet of Things
7
if (cond.):
statement 1
statement 2
elif (cond.):
statement 1
statement 2
else:
statement 1
statement 2
while (cond.):
statement 1
statement 2
x = [1,2,3,4]
for i in x:
statement 1
statement 2
8. Controlling Statements
(contd..)
Introduction to Internet of Things
8
Break
for s in "string":
if s == ‘n':
break
print (s)
print
“End”
Continue
for s in "string":
if s == ‘y':
continue
print (s)
print “End”
9. Functions in Python
Introduction to Internet of Things
9
# Defining the function
Defining a function
Without return value
def funct_name(arg1, arg2, arg3):
statement 1
statement 2
With return value
def funct_name(arg1, arg2, arg3):
# Defining the function
statement 1
statement 2
return x
# Returning the value
10. Functions in
Python
Introduction to Internet of Things 10
Calling a function
def example (str):
print (str + “!”)
example (“Hi”) # Calling the function
Output:: Hi!
11. Functions in Python
(contd..)
Introduction to Internet of Things 11
Example showing function returning multiple values
def greater(x, y):
if x > y:
return x, y
else:
return
y, x
val = greater(10,
100) print(val)
Output:: (100,10)
12. Functions as Objects
Introduction to Internet of Things 12
Functions can also be assigned and reassigned to the variables.
Example:
def add (a,b)
return a+b
print (add(4,6))
c = add(4,6)
print c
Output:: 10 10
13. Variable Scope in
Python
Introduction to Internet of Things 13
Global variables:
These are the variables declared out of any function , but can be
accessed inside as well as outside the function.
Local variables:
These are the ones that are declared inside a function.
15. Example showing
Variable Scope
var = 10
Introduction to Internet of Things 15
def example():
var = 100
print(var)
# calling the function
example()
print(var)
Output:: 100
10
16. Modules in Python
Introduction to Internet of Things 16
Any segment of code fulfilling a particular task that can be
used commonly by everyone is termed as a module.
Syntax:
import module_name #At the top of the code
using module_name.var #To access functions and values
with ‘var’ in the module
17. Modules in Python
(contd..)
Introduction to Internet of Things 17
Example:
import random
for i in range(1,10):
val = random.randint(1,10)
print (val)
Output:: varies with each execution
18. Modules in Python
(contd..)
Introduction to Internet of Things 18
We can also access only a particular function from a module.
Example:
from math import pi
print (pi)
Output:: 3.14159
19. Exception Handling in
Python
Introduction to Internet of Things 19
An error that is generated during execution of a program, is
termed as exception.
Syntax:
try:
statements
except _Exception_:
statement
s else:
statemen
ts
20. Exception Handling in Python
(contd..)
Introduction to Internet of Things 20
Example:
while True:
try:
n = input ("Please enter an integer: ")
n = int (n)
break
except ValueError:
print
"No valid
integer! "
print “It is an
integer!"
21. Example Code: to check number is prime or not
Introduction to Internet of Things 21
x = int (input("Enter a number: "))
def prime (num):
if num > 1:
for i in
range(2,num):
if (num % i)
== 0:
print (num,"is not a prime number")
print (i,“is a factor of”,num)
break
else:
print(num,"is a prime number")
else:
print(num,"is not a prime number")
prime (x)
23. File Read Write
Operations
Introduction to Internet of Things
2
Python allows you to read and write files
No separate module or library required
Three basic steps
Open a file
Read/Write
Close the file
24. File Read Write Operations
(contd..)
Introduction to Internet of Things
3
Opening a File:
Open() function is used to open a file, returns a file object
open(file_name, mode)
Mode: Four basic modes to open a file
r: read mode
w: write mode
a: append mode
r+: both read
and write mode
25. File Read Write Operations
(contd..)
Introduction to Internet of Things
4
Read from a file:
read(): Reads from a file
file=open(‘data.txt’, ‘r’)
file.read()
Write to a file:
Write(): Writes to a file
file=open(‘data.txt’, ‘w’)
file.write(‘writing to the file’)
26. File Read Write Operations
(contd..)
Introduction to Internet of Things
5
Closing a file:
Close(): This is done to ensure that the file is free to use for other resources
file.close()
Using WITH to open a file:
Good practice to handle exception while file read/write operation
Ensures the file is closed after the operation is completed, even if an exception is
encountered
with open(“data.txt","w") as file:
file.write(“writing to the text file”)
file.close()
27. File Read Write Operations code +
image
Introduction to Internet of Things
6
with open("PythonProgram.txt","w") as file:
file.write("Writing data")
file.close()
with open("PythonProgram.txt","r") as file:
f=file.read()
print('Reading from the filen')
print (f)
file.close()
28. File Read Write Operations
(contd..)
Introduction to Internet of Things
7
Comma Separated Values Files
CSV module supported for CSV files
Read:
with open(file, "r") as csv_file:
reader = csv.reader(csv_file)
print("Reading from the CSV Filen")
for row in reader:
print(" ".join(row))
csv_file.close()
Write:
data = ["1,2,3,4,5,6,7,8,9".split(",")]
file = "output.csv"
with open(file, "w") as csv_file:
writer = csv.writer(csv_file, delimiter=',')
print("Writing CSV")
for line in data:
writer.writerow(line)
csv_file.close()
29. File Read Write Operations
(contd..)
Introduction to Internet of Things
8
30. Image Read/Write
Operations
Introduction to Internet of Things
9
Python supports PIL library for image related operations
Install PIL through PIP
sudo pip install pillow
PIL is supported till python version 2.7. Pillow supports the 3x version of
python.
31. Image Read/Write
Operations
Introduction to Internet of Things 10
Reading Image in Python:
PIL: Python Image Library is used to work with image files
from PIL import Image
Open an image file
image=Image.open(image_name)
Display the image
image.show()
32. Image Read/Write
Operations (contd..)
Introduction to Internet of Things 11
Resize(): Resizes the image to the specified size
image.resize(255,255)
Rotate(): Rotates the image to the specified degrees, counter clockwise
image.rotate(90)
Format:
Size:
Mode:
Gives the format of the image
Gives a tuple with 2 values as width and height of the image, in pixels
Gives the band of the image, ‘L’ for grey scale, ‘RGB’ for true colour image
print(image.format, image.size, image.mode)
33. Image Read/Write Operations
(contd..)
Introduction to Internet of Things 12
Convert image to different mode:
Any image can be converted from one mode to ‘L’ or ‘RGB’
mode
conv_image=image.convert(‘L’)
Conversion between modes other that ‘L’ and ‘RGB’ needs
conversion into any of these 2 intermediate mode
36. Networking in Python
Introduction to Internet of Things 15
Python provides network services for client server model.
Socket support in the operating system allows to implement clients
and servers for both connection-oriented and connectionless
protocols.
Python has libraries that provide higher-level access to specific
application-level network protocols.
37. Networking in Python
(contd..)
Introduction to Internet of Things 16
Syntax for creating a socket:
s = socket.socket (socket_family, socket_type, protocol=0)
socket_family − AF_UNIX or AF_INET
socket_type − SOCK_STREAM or SOCK_DGRAM
protocol − default ‘0’.
38. Example - simple server
Introduction to Internet of Things 17
The socket waits until a client connects to the port, and then returns a
connection object that represents the connection to that client.
import socket
import sys
# Create a
TCP/IP socket
sock =
socket.socket(
socket.AF_IN
ET,
socket.SOCK_
STREAM)
# Bind the socket to the port
server_address = ('10.14.88.82', 2017)
print >>sys.stderr, 'starting up on %s port %s' % server_address
sock.bind(server_address)
39. Example - simple server
(contd..)
Introduction to Internet of Things 18
# Listen for incoming connections
sock.listen(1)
connection, client_address = sock.accept()
#Receive command
data = connection.recv(1024)
print(data)
sock.close()
40. Example - simple client
Introduction to Internet of Things 19
import socket
import sys
# Create a
TCP/IP socket
client_socket
=
socket.socket(
socket.AF_IN
ET,
socket.SOCK_
STREAM)
#Connect to Listener socket
client_socket.connect(("10.14.88.82", 2017))
print>>sys.stderr,'Connection Established'
#Send command
client_socket.send('Message to the server')
print('Data sent successfully')