0% found this document useful (0 votes)
16 views

Python Materials

Uploaded by

Rohini B
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Python Materials

Uploaded by

Rohini B
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Uses for Automation

Scripts can be used for automating specific tasks. Automation is used to replace a repetitive manual
step with one that happens automatically. Humans are fallible. They can become tired, make
mistakes, fail to follow instructions, be inconsistent in their job performance, and more. In contrast,
automated processes complete instructions exactly as coded, in a consistent manner. They can run
24 hours a day, everyday, without tiring. For many tasks that are appropriate for automation, it can
be more cost effective to use automation than human labor.

Appropriate uses for automation include:


 The automatic timing and regulation of traffic lights
 A repetitive task that is at high risk for human error
 Sending commands to a computer
 Detecting and removing duplicates of data
 Sending automated emails that are personalized by pulling individual names from a
database and plugging them into the email
 Updating a large number of file permissions
 Reporting on system data, like disk or memory usage
 Installing software
 Generating reports
 Deploying a file or a computer program to all computers on a company network
 Using a configuration management system to deploy software patches, after a human has
designed the system
 Populating an e-commerce site with products
 Setting the home directory and access permissions for users

Automation is not always an appropriate or complete


solution
Automation cannot perform all human work. Tasks that call for human creativity, social connection,
psychology, flexibility, ingenuity, evaluation, and/or complex analytic work are not good candidates
for full automation. Sometimes automation can be used to perform one or more subtasks of a larger
set of tasks – but – human intervention is required to complete the tasks. The following are some
examples of tasks that cannot or should not be fully automated:

 Items that require human evaluation and analytic skills:


o Designing a configuration management system
o Investigating and troubleshooting all end user problems
o Writing a computer program
o Building a new startup business
 Items that require human creativity and/or an eye for aesthetic qualities:
o Designing an attractive webpage (AI can do this, but simple automation cannot)
o Wedding photography
o Haircuts and styling
 Items that cannot be automated due to basic physics:
o Troubleshooting or repairing machines that cannot power on or boot up
 Items that need human interaction, psychology, and/or evaluation skills:
o Interviewing and hiring new employees
o Customer service (chat bots cannot address every customer service need)
 Items that should not be fully automated due to costs and safety:
o Grocery store checkout process, including bagging groceries
o Tasks that are less expensive to perform manually

Artificial Intelligence
It is important to understand that basic automation is not the same as artificial intelligence.
Automation is used to explicitly instruct a machine on how to perform a task. Artificial intelligence
(AI) involves training a computing machine to perform more complex tasks through a process called
machine learning. This process prepares the AI software to perform new tasks without a human
needing to program explicit instructions for each task. Although AI is often used for automating
human tasks, AI automation is much more complex than basic automation.

Study Guide: Introduction to


Programming
Your first practice quiz is coming up soon. This handy study guide should help you prepare for that
quiz. The practice quizzes do not count towards your grade in this course. Practice quizzes are
opportunities for you to check your understanding of the materials before you take the graded
assessments at the end of each module.

Key Terms
 Programming code - Programming code is a set of written computer instructions, guided by
rules, using a computer programming language. It might help to think of the computer
instructions as a detailed, step-by-step recipe for performing tasks. The instructions tell
computers and machines how to perform an action. Programming code may also be referred
to as source code or scripts.

 Programming languages - Programming languages are similar to human spoken languages in


that they both use syntax and semantics. Programming languages are used to write
computer programs. Some common programming languages include Python, Java, C, C++,
C#, and R.

 Syntax - Syntax is a set of rules for how statements are constructed in both human and
computer languages. Programming syntax includes rules for the order of elements in
programming instructions, as well as the use of special characters and their placements in
statements. This concept is similar to the syntax rules for grammar and punctuation in
human language.

 Semantics - Semantics refers to the intended meaning or effect of statements, or collections


of words, in both human and computer languages. Semantic errors are also referred to as
logical errors.

 Computer program - A computer program is a step-by-step list of instructions that a


computer follows to reach an intended goal. It is important to be clear and precise about the
actions a computer program is supposed to perform because computers will do exactly what
they are instructed to do. Computer programs can be long, complex, and accomplish a
variety of tasks. They are often developed by computer programmers and software
engineers, but anyone can learn to create them. Computer programs may involve a
structured development cycle. They can be written in a wide variety of programming
languages, such as Python, Java, C++, R, and more. The completed format of a program is
often a single executable file.

 Script - Scripts are usually shorter and less complex than computer programs. Scripts are
often used to automate specific tasks. However, they can be used for complex tasks if
needed. Scripts are often written by IT professionals, but anyone can learn to write scripts.
Scripts have a shorter, less structured development cycle as compared to the development
of complex computer programs and software. Scripts can be written in a variety of
programming languages, like Python, Javascript, Ruby, Bash, and more. Some scripting
languages are interpreted languages and are only compatible with certain platforms.

Python Resources
More About Python
Using Python on your own
The best way to learn any programming language is to practice it on your own as much as you can.
If you have Python installed on your computer, you can execute the interpreter by running the
python3 command (or just python on Windows), and you can close it by typing exit() or Ctrl-D.

If you don’t already have Python installed on your machine, that’s alright. We’ll explain how to install
it in an upcoming course.

Python practice resources


In the meantime, you can still practice by using one of the many online Python interpreters or
codepads available online. There’s not much difference between an interpreter and a codepad. An
interpreter is more interactive than a codepad, but they both let you execute code and see the
results.

Below, you’ll find links to some of the most popular online interpreters and codepads. Give them a
go to find your favorite.

 https://www.python.org/shell/
 https://www.onlinegdb.com/online_python_interpreter
 https://repl.it/languages/python3
 https://www.tutorialspoint.com/execute_python3_online.php
 https://rextester.com/l/python3_online_compiler
 https://trinket.io/python3
Additional Python resources
While this course will give you information about how Python works and how to write scripts in
Python, you’ll likely want to find out more about specific parts of the language. Here are some great
ways to help you find additional info:

 Read the official Python documentation.


 Search for answers or ask a question on Stack Overflow.
 Subscribe to the Python tutor mailing list, where you can ask questions and collaborate with
other Python learners.
 Subscribe to the Python-announce mailing list to read about the latest updates in the
language.
Python history and current status
Python was released almost 30 years ago and has a rich history. You can read more about it on the
History of Python Wikipedia page or in the section on the history of the software from the official
Python documentation.

Python has recently been called the fastest growing programming language. If you're interested in
why this is and how it’s measured, you can find out more in these articles:

 The Incredible Growth of Python (Stack Overflow)


 Why is Python Growing So Quickly - Future Trends (Netguru)
 Python Trends (TechnoBrains)
 Developer Survey Results 2018 (Stack Overflow)

Study Guide: Introduction to Python


This study guide provides a quick-reference summary of what you learned in this lesson and serves
as a guide for the upcoming practice quiz.

In this segment, you learned that Python is a general purpose programming language that is
commonly used for scripting and automation, as well as to develop a wide variety of applications.
Python is compatible with most operating systems, including Windows, Linux, and Mac OS, and is
updated every few years. Python can also run on a variety of machines, such as servers,
workstations, PCs, mobile devices, IoT, and more.

Python is widely used in the IT field, including IT support, system administration, web development,
machine learning, data analytics, and more. Python can be used to calculate statistics, run your e-
commerce site, process images, interact with web services, and do a whole host of other tasks.
Python instructions resemble the English language, which is what makes it easier to learn and
understand when compared to other programming languages.

Python is:

 a general purpose scripting language;


 a popular language used to code a variety of applications;
 a frequently used tool for automation;
 a cross-platform compatible language;
 a beginner-friendly language.

Python is not:

 a platform-specific / OS-specific scripting language;


 a client-side scripting language;
 a purely object-oriented programming language.

Code comparison with Python


You will be learning about both Python and Bash scripting in this program. The following code
illustrates a syntax difference between the two languages:

Print to screen in Python Print to screen in Bash


>> print("Hello, how are you?") >> echo Hello, how are you?

Hello, how are you? Hello, how are you?

Key Terms
 Platform-specific / OS specific scripting language - Platform-specific scripting languages, like
PowerShell (for Windows) and Bash (for Linux), are used by system administrators on those
platforms.
 Client-side scripting language - Client-side scripting languages, like JavaScript, are used
mostly for web programming. The scripts are transferred from a web server to the end-user’s
internet browser, then executed in the browser.
 Machine language - Machine language is the lowest-level computer language. It
communicates directly with computing machines in binary code (ones and zeros). In binary
code, one equals a pulse of electricity and zero equals no electrical pulse. Machine language
instructions are made from translating languages like Python into complex patterns of ones
and zeros.
 Cross-platform language - Programming language that is compatible with one or more
platforms / operating systems (e.g., Windows, Linux, Mac, iOS, Android).
 Object-oriented programming language - In object-oriented programming languages, most
coding elements are considered to be objects with configurable properties. For example, a
form field is an object that can be configured to accept only dates as input in the mm/dd/yy
format, and can be configured to read from and write to a specific database.
 Python interpreter - An interpreter is the program that reads and executes Python code by
translating Python code into computer instructions.

Resources
For additional Python practice, the following links will take you to several popular online interpreters
and codepads:

 Welcome to Python
 Online Python Interpreter
 Create a new Repl
 Online Python-3 Compiler (Interpreter)
 Compile Python 3 Online
 Your Python Trinket

 Automation - Automation is used to replace a repetitive manual step with one that
happens automatically.
 Output - Output is the end result of a task performed by a function or computer program.
Output can include a single value, a report, entries into a database, and more.

 Input - Input is information that is provided to a program by the end user. Input can be
text, voice, images, biometrics, and more.

 Functions - A function is a reusable block of code that performs a specific task.

 Variables - Variables are used to temporarily store changeable values in programming


code.

You might also like