Thursday, 18 January 2024

Python Learning Session-01- Introduction

 

 
Title Python Learning Session-01- Introduction


Why Program?

when we will access any application, we thought

Why Program? what was the key aspect of it.

Now a days all things are going to online. day by day in the faster growing world we need to also update and aware about the thing are going around us, when we start to learning about the programming and development of any software are desktop application or is a web application.

 

Users vs. Programmers

 

         - Computers offer various tools for different purposes, such as writing, calculating, navigating, organizing, etc.

         - Programmers master the logic and the syntax of the computer language to create and modify these tools

         - Programmers use some tools to develop new tools that can be useful for themselves or for other users

         - Programmers can automate tasks by writing small programs that perform specific actions

Why be a Programmer?

- To get some task done - we are the user and programmer

  - Clean up survey data

    - Read the data from a CSV file

    - Remove any rows with missing or invalid values

    - Convert the data to a suitable format for analysis

    - Save the cleaned data to a new CSV file

- To produce something for others to use - a programming job

  - Fix a performance problem in the software

    - Identify the bottleneck in the code using a profiler

    - Optimize the algorithm or data structure that causes the slowdown

    - Test the code for correctness and efficiency

    - Document the changes and update the version control

    - Add a guestbook to a web site

...

 

    - Create a database table to store the guestbook entries

    - Write a python script to handle the form submission and validation

    - Write a python script to display the guestbook entries on the web page

    - Add some CSS and JavaScript to style and enhance the user interface

 

- We create software solutions for end users

- End users are our clients and benefactors - we aim to satisfy their needs and expectations - they pay us with money when they are happy

- We handle the data, information, and networks on behalf of the end users

- We use hardware and software as our tools and partners in this endeavor

 

Python IDE Interface



 

Hardware Architecture of the Software are working together with desire hardware


Process Flow diagram



         Central Processing Unit:  Runs the Program - The CPU is
always wondering “what to do next”.  Not the brains
exactly - very dumb but very very fast

         Input Devices:  Keyboard, Mouse, Touch Screen

         Output Devices:  Screen, Speakers, Printer, DVD Burner

         Main Memory:  Fast small temporary storage - lost on reboot - aka RAM

         Secondary Memory:  Slower large permanent storage - lasts until deleted - disk drive / memory stick

 

Process Flow Diagram about how to convert any program we writing any language are converting to the machine language binary code 0 and 1 format are shown here,  



Python as a Language

Parse tongue is the language of serpents and those who can converse with them.  An individual who can speak Parse tongue is known as a Parse mouth. It is a very uncommon skill, and may be hereditary. Nearly all known Parse mouths are descended from Salazar Slytherin.

Python is the language of the Python Interpreter and those who can converse with it. An individual who can speak Python is known as a Pythonista. It is a very uncommon skill, and may be hereditary. Nearly all known Pythonistas use software initially developed by Guido van Rossum.

 



 Early Learner: Syntax Errors

We need to learn the Python language so we can communicate our instructions to Python. You must remember that you are intelligent and can learn. The computer is simple and very fast, but cannot learn. So it is easier for you to learn Python than for the computer to learn English...


Basic Python IDE interface 





Sentences or Lines



Elements of Python:

# Vocabulary / Words - Variables and Reserved words

- Variables are names that refer to values stored in memory

- Reserved words are keywords that have a special meaning in the programming language and cannot be used as variable names

- Examples of reserved words in Python are: if, else, for, while, def, class, etc.


# Sentence structure - valid syntax patterns

- Syntax is the set of rules that define how to write statements and expressions in a programming language

- Valid syntax patterns are combinations of symbols, keywords, operators, and operands that form meaningful instructions for the computer

- Examples of valid syntax patterns in Python are: if condition: block, for variable in inerrable: block, def function_name(parameters): block, etc.


# Story structure - constructing a program for a purpose

- A program is a sequence of instructions that perform a specific task or solve a problem

- Constructing a program for a purpose involves defining the input, output, and logic of the program

- Examples of constructing a program for a purpose are: writing a function that calculates the area of a circle given its radius, writing a loop that prints the numbers from 1 to 10, writing a class that represents a person with attributes and methods, etc.

 

Reserved Words

You cannot use reserved words as variable names / identifiers

 


Python Scripts

 

              Interactive Python is good for experiments and programs of 3-4 lines long.

         Most programs are much longer, so we type them into a file and tell Python to run the commands in the file.

         In a sense, we are “giving Python a script”.

         As a convention, we add “.py” as the suffix on the end of these files to indicate they contain Python.

         Interactive

 -  You type directly to Python one line at a time and it responds

         Script

 -  You enter a sequence of statements (lines) into a file using a text  editor and tell Python to execute the statements in the file

         Like a recipe or installation instructions, a program is a sequence of steps to be done in order.

         Some steps are conditional - they may be skipped.

         Sometimes a step or group of steps is to be repeated.

         Sometimes we store a set of steps to be used over and over as needed several places throughout the program 







No comments: