Download presentation
Presentation is loading. Please wait.
1
CST 1101 Problem Solving Using Computers
2
CST 1101 Topic 02: “Hello World”
3
What Makes Learning Python Important?
Python lets you work quickly to integrate systems as a scripting or glue language. It’s also suited for Rapid Application Develop (RAD). The game Civilization 4 has all its inner logic, including AI, implemented in Python. NASA uses Python in its Integrated Planning System as a standard scripting language. Features: Simple to learn and easily read Associated web frameworks for developing web-based applications Free interpreter and standard library available in source or binary on major platforms
4
Who Uses Python? Professions and Industries:
Python developers, software engineers, back end developers, Python programmers Used by employers in information technology, engineering, professional services and design Major Organizations: Google, Pinterest, Instagram, YouTube, DropBox, NASA, ESRI Specializations and Industries: Web and Internet development (frameworks, micro-frameworks and advanced content management systems); scientific and numeric computing; desktop graphical user interfaces (GUIs)
5
Why Python? Python is a scripting language :
Free Portable dynamically-typed object-oriented Python Combines software engineering features of traditional systems languages with power and flexibility of scripting languages.
6
Traditional vs Scripting Languages
Traditional languages (C++, Java) evolved for large-scale programming Emphasis on structure and discipline Simple problems != simple programs Scripting languages (Perl, Python, TCL) designed for simplicity and flexibility. Simple problems = simple, elegant solutions More amenable to experimentation and incremental development Python: Ideal first language, useful throughout curriculum (Information and Data Management, Data Mining)
7
Running Python Programs
Hybrid compiled/interpreted architecture We will use Integrated Development Learning Environment (IDLE), an integrated development environment for Python and Python 3.6 Options: Start Interpreter from command line (>>> ) Type program statements Import script file Directly from IDLE
8
Download IDLE and Python
9
IDLE A quick way to launch IDLE is from Window’s Start Menu
choose IDLE (Python GUI) If you use Windows 10, see the example For Windows 7 or Vista see the example in the HowToStartIDLE.pdf tutorial
10
IDLE Shell Put the statement that you want to be displayed on the screen in double quotes. This is a String type that we will discuss later.
11
>>>help() command starts interactive help
Ctrl-C command exits interactive help Interactive help for the if operator
12
Creating and Running a Python program
To create a new Python program, choose File New File to open a text editor window A new window will be open for editing To save do File Save as To run do Run Run module or click F5
13
Saving file If the file that you try to run does not have all the recent updates you will see the following window. Click OK, follow the prompt and save your work
14
Comments Comments improve code readability and documentation
Comments are not executed by a computer (a compiler skips them): Comments are for programmers and users Comments are not for computers
15
Comments Start comments with # – the rest of line is ignored.
Can include a “documentation string” as the first line of any new function or class that you define. The development environment, debugger, and other tools use it: it’s good style to document your code with comments.
16
Using Python Shell as a Calculator
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.