This document provides an introduction to Python programming. It outlines the course objectives of understanding Python basics and learning to solve problems. It describes the course contents which cover introduction to Python, using the IDLE editor, writing first programs, and writing programs to calculate beam reactions and draw shear force and bending moment diagrams. It then discusses what Python is, how it is used for web development, software development, and mathematics. It explains that Python is a good first language because it has a simple syntax and supports a wide range of applications. Finally, it provides an overview of how Python source code is compiled and run, including being compiled into bytecode by the interpreter and translated by the virtual machine.
2. Course learning objectives
1. To understand the basics Python language
2.
To learn to solve problems using Python basics of Data expression and Statements
CONTENTS
Unit I Introduction to Python Programming
Unit II How to use IDLE to develop programs:
Unit III How to write your first programs:
Unit IV To write a program to calculate reactions of different types of beams with
different loading and supporting conditions. Examples
Unit V To write program to calculate and draw SFD and BMS of different types of
beams with different loading and supporting conditions. Examples
6. INTRODUCTION
Programming is writing computer code to create a
program, in order to solve a problem. Programs
consist of a series of instructions to tell a computer
exactly what to do and how to do it.
A programming language is a vocabulary and set of
grammatical rules for instructing a computer or
computing device to perform specific tasks.
10. What is Python?
Python is a popular programming language.
It was created by Guido van Rossum, of Netherland
and released in 1991.
It is used for:
web development (server-side),
software development,
mathematics,
system scripting. etc
11. 1. Python can be used on a server to create web applications.
Eg of Web Applications:
Social Media Platform: Facebook, Instagram, Twitter etc
E-Commerce Websites: Amazon, Flipkart, Meesho etc
Educational Platforms: Courseera, Moodle
Online Gaming: Fortnite, World of Warcraft, and Minecraft
Chat and Messaging Apps : Whatsapp Web
What can Python do?
12. 2. Python can be used alongside software to create workflows.
Eg: Image Processing, Financial and Quantitative Analysis, Language Processing etc
3. Python can connect to database systems. It can also read and modify files.
4. Python can be used to handle big data and perform complex mathematics.
5. Python can be used for rapid prototyping, or for production-ready software
development.
13. Why Python is a great first language?
Python has a simple syntax that's easier to read and use than most other languages.
Python has most of the features of traditional programming languages. As a result, you can
use Python to learn the concepts and skills that apply to those languages too.
Python supports the development of a wide range of programs, including games, web
applications, and system administration.
Python is used by many successful companies, including Google, IBM, Disney, and EA
Games. As a result, knowing Python is a valuable skill.
Python is open source. There are many advantages to being open source.
14. THREE TYPES OF PYTHON APPLICATIONS
An application, or app, is a computer software that perform a task or related set of tasks.
A console application is a desktop application that uses the Console to interact with the
user
15. The first type is a console application. In this type of application, you enter commands at
the command prompt in the console that's available from your operating system.(In this
case, a console application is being run on a Windows system. As a result, it uses the
Command Prompt window that's available from Windows.
On a Mac OS X system, though, a console application runs in the Terminal window.
Because console applications are the easiest type of application to develop, you'll work
with console applications in the first three sections of this book
16. A GUI application is an application that uses s Graphical User Interface to interact with
the user
17. The second type of Python application is a GUI application. That's an
application that has a graphical user interface (GUI).
In this figure, the GUI application performs the same tasks as the console
application In other words, it gets the same input from the user, performs the
same calculation, and displays the same result. However, the GUI application
is more user-friendly and intuitive
18. A web application typically gets requests from a web browser, processes them on a
web server, and returns the responses to the web browser
19. The third type of application shown in this figure is a web application.)Unlike a
desktop application, which runs directly on your computer, a web application
can be called by a web browser that's running on a computer or mobile device
and can use a server to process or store data)
In this figure, the web application performs the same task as the console and
GUI applications)
20. How Python compiles and runs source code
Step 1: The programmer uses a text editor or
IDE to enter and edit the source code. Then,
the programmer saves the source code to a file
with a .py extension.
Step 2 : The source code is compiled by the
Python interpreter into bytecode.
Step 3: The bytecode is translated by the
Python virtual machine into instructions that
can interact with the operating system
of the computer.
21. DESCRIPTION:
Although this procedure is complicated, it runs behind the scenes when
you're developing Python programs. As a result, it's mostly invisible to the
developer.
Python bytecode can be run on any operating system that has a Python
virtual machine. That's why Python is said to be platform-independent.
If the program imports modules, the Python interpreter saves the compiled
bytecode for those modules in files that have .pyc or pyo extensions. This
is an import optimization that can improve the startup time for a program.
22. HOW DISK STORAGE AND MAIN MEMORY WORK TOGETHER
MAIN MEMORY AND DISK STORAGE AS AN APPLICATION RUNS
Operating System
The application that's running
The data for the application
System Storage
Application software
Application data
Main Memory Disk Storage
How disk storage and main memory work together
When you start the computer, it loads the operating system into main memory. Then, you use the features
of the operating system to start an application..
When you start an application, the operating system loads it into main memory. Then, it runs the
application.
As the application runs, it may read data from disk storage into main memory orwrite data from main
memory to disk storage
23. .DESCRIPTION:
The system software for a computer provides all of the software that is needed
for running the applications, including the operating system.
The applications software consists of the applications that are available on the
system.
A computer consists of a CPU (Central Processing Unit) and main memory, also
known as RAM (Random Access Memory).
The data in main memory is lost when an application ends. Disk storage is used
for persistent data storage which remains after an application ends.
Main memory and disk storage are commonly measured in megabytes (MB) and