0% found this document useful (0 votes)
2 views20 pages

Python 3 Installation and Basics Guide

This document serves as an introduction to Python 3, covering installation, launching methods, naming conventions, syntax, and standard modules. It emphasizes the importance of using the correct text editor and provides examples of Python's capabilities. Additionally, it outlines various programming concepts such as exception handling and user input management.

Uploaded by

peserta.07553
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)
2 views20 pages

Python 3 Installation and Basics Guide

This document serves as an introduction to Python 3, covering installation, launching methods, naming conventions, syntax, and standard modules. It emphasizes the importance of using the correct text editor and provides examples of Python's capabilities. Additionally, it outlines various programming concepts such as exception handling and user input management.

Uploaded by

peserta.07553
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

INTRODUCTION TO PY THON 3

Pembelajaran Mesin
Python Installation

• Before you download anything, check if you


have Python already installed on your by
typing the following command in a command
shell:
python3 –V
• Use any text editor that can create, edit, and
save Python scripts and save them as plain
text files (don’t use Microsoft Word).
• After you have Python installed and
configured on your machine, you are ready to
work with the Python scripts
Launching Python on Your
Machine
There are three different ways to launch Python:
1. Use the Python interactive interpreter.
2. Launch Python scripts from the command
line.
3. Use an IDE.
The Python Interactive
Interpreter
• It may be argued that if we have access to
extra knowledge such as the exact
composition of the coin, its initial position, the
force and its direction that is applied to the
coin when tossing it, where and how it is
caught, and so forth, the exact outcome of the
toss can be predicted.
• The extra pieces of knowledge that we do not
have access to are named unobservable
variables.
• In the coin tossing example, the only
observable variable is the outcome of the
toss.
The Python Naming
Convention
In addition, Python has the following naming
convention:
• Class names start with an uppercase letter
and all other identifiers with a lowercase
letter.
• An initial underscore is used for private
identifiers.
• Two initial underscores is used for strongly
private identifiers.
The Python Syntax

• It may be argued that if we have access to


extra knowledge such as the exact
composition of the coin, its initial position, the
force and its direction that is applied to the
coin when tossing it, where and how it is
caught, and so forth, the exact outcome of the
toss can be predicted.
• The extra pieces of knowledge that we do not
have access to are named unobservable
variables.
• In the coin tossing example, the only
observable variable is the outcome of the
toss.
The Python Syntax

• It may be argued that if we have access to


extra knowledge such as the exact
composition of the coin, its initial position, the
force and its direction that is applied to the
coin when tossing it, where and how it is
caught, and so forth, the exact outcome of the
toss can be predicted.
• The extra pieces of knowledge that we do not
have access to are named unobservable
variables.
• In the coin tossing example, the only
observable variable is the outcome of the
toss.
The Python Syntax

• It may be argued that if we have access to


extra knowledge such as the exact
composition of the coin, its initial position, the
force and its direction that is applied to the
coin when tossing it, where and how it is
caught, and so forth, the exact outcome of the
toss can be predicted.
• The extra pieces of knowledge that we do not
have access to are named unobservable
variables.
• In the coin tossing example, the only
observable variable is the outcome of the
toss.
Some Standard Modules in
Python
• The Python Standard Library provides many
modules that can simplify your own Python
scripts. A list of the Standard Library modules
is here:
[Link]
• Some of the most important Python modules
include cgi, math, os, pickle, random, re,
socket, sys, time, and urllib.
• The code samples in this book use the
modules math, os, random, re, socket, sys,
time, and urllib. You need to import these
modules in order to use them in your code.
Working with Numbers
Working with Other Bases
Working with Strings
Working with Strings
Working with Strings
Working with Dates
Exception Handling
Handling User Input
Command Line Arguments
Terimakasih

You might also like