0% found this document useful (0 votes)
63 views2 pages

CS121

The document provides an overview of Python programming language including its characteristics, data types, literals, simple assignment statements, identifiers and some common Python programming concepts like strings, lists, tuples, and dictionaries. It discusses why Python is a good choice for programming and its applications in areas like databases, GUI development and more. The document also covers basic elements of Python like data type conversion and input functions.

Uploaded by

Ikon Trash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views2 pages

CS121

The document provides an overview of Python programming language including its characteristics, data types, literals, simple assignment statements, identifiers and some common Python programming concepts like strings, lists, tuples, and dictionaries. It discusses why Python is a good choice for programming and its applications in areas like databases, GUI development and more. The document also covers basic elements of Python like data type conversion and input functions.

Uploaded by

Ikon Trash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CS 121 ADVANCED COMPUTER PROGRAMMING - hw.

islower()
o String held in your variable remains the same
MODULE 1: INTRODUCTION TO PYTHON
o The method returns am altered by string
PROGRAMMING LANGUAGES
o Changing the variable requires reassignment
Introduction to Python - hw = hw.upper()
- hw now equals “HELLO WORLD”
o High-level programming language
o Open source and community driven List
o “Batteries Included”
o The information stays in the order you place
o Dynamic typed
it in until you modify that order
o Source can be compiled or run just in time
o Methods return a string or subset of the list
o Similar to perl, tcl, ruby
or modify the list to add or remove
Why Python? components
o Written as var[index], index refers to order
o There is a considerable base of developers within set (think card number, starting at 0)
already using the language
o “Tried and true” language that has been in Lists in ArcToolbox
development since 1991
o You will create lists:
o Can interface with the Component Object
- Layers as inputs
Model (COM) used by Windows
- Attributes to match
o Can interface with Open Source GIS toolsets
- Arrays of objects
Why not Visual Basic? o You will work with lists:
- List of field names
o VB is still the method of configuring and - List of selected features
customizing ArcMap
o Python scripts can be placed in Arc Toolbox Tuples
o Python can be run from the command line
o Iterable arrays of objects
without ArcMap
o Immutable – once created, unchangeable
o Rapid prototyping, ease of authoring, etc.
o Redeclare to add or remove items
Python Interfaces o Example uses
- County Names
o IDLE- a cross-platform Python development - Land use codes
environment - Ordered set of functions
- Color-coding
- Debugging Dictionaries
- Auto-indent
o Sets of key and value pairs
- Interactive Shell
o Allows to identify values by descriptive name
o PythonWin- a Windows only interface to
o Keys are unordered unless explicitly sorted
Python
o Keys are unique:
o Python Shell- running ‘python’ from the
- var[‘item’] = “apple”
command line opens this interactive shell
- var[‘item’] = “banana”
More than just printing - print var[‘item’] prints just
banana
o Python is an object oriented language
o “hello world” is a string Indention and Blocks

String Methods o Python uses whitespace and indents to


denote blocks of code
o Assign a string to a variable o Line of codes that begin a block end in a
o In this case “hw” colon
- hw.title() o Lines within the code block are intended at
- hw.upper() the same level
- hw.isdigit() o Remove the indentation to end a code block
Application of Python
Programming/ Computer Programming o easy to learn
o easy to read
o Way of giving an instruction to a computer to
o easy to maintain
perform a specific task.
o broad standard library
o refer to as coding
o interactive mode
o was developed which is based in human
o portable
natural language
o extendable
o allow to give instructions to a computer in a
o databases
language the computer understands
o gui programming
Low- level Languages o scalable

o no abstraction and the programming rely


closely to the computer architecture
MODULE 2. BASIC ELEMENTS OF PYTHON
o assembly languages (deals with hardware)
o machine code Literals
High- level Languages o used to indicate a specific value, which can be
assigned to a variable
o high-level of abstraction and focus mainly on
o the parameter values passed to the print
the programming logic rather than
function
underlying hardware architecture
o python Simple Assignment Statement
o html
o Python will automatically clear old values out
o cbol
of memory in a process known as garbage
o c language
collection
Translators
Assigning Input
o task is to translate the source code into
o input is accomplished via an assignment
computer codes which is basically a set of
statement combined with a built-in function
binary numbers
called input
o source code - translator - binary/ object
code/ program/ app Data Type Conversion
Python o integer- float
o integer-string
o general-purpose, interpreted, interactive,
o string-float
object- oriented, and high-level programming
o string-integer
language
o float-integer
Why to Learn Python? o float-string
o Interpreted Identifiers
o Interactive
o different names for variables
o Object-oriented
o case sensitive
o Beginner’s language
o has some rules
o Direct syntax
o must begin with a letter or underscore, may
Characteristics of Python followed by any sequence of letters, digits, or
underscores
o Supports functional and structured
o reserved words- cannot be used by
programming methods
programmers as ordinary identifiers
o Used as scripting language or can be compiles
to byte-code for large applications

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy