100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Class notes

Chapter 8 Intro to Data Analytics with Python II MIS 180 McGraw Hill Textbook

Rating
-
Sold
-
Pages
19
Uploaded on
17-12-2024
Written in
2024/2025

In-depth SOCIAL MEDIA MARKETING McGraw Hill notes for Connect Master Online Access for Management Information Systems. Course taken Spring '24 at San Diego State University SDSU with Jordi Conrado. Chapter notes 8 out of 14. python notes, learning python, python for beginners, mis 180 python introduction

Show more Read less
Institution
MIS 180
Course
MIS 180










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
MIS 180
Course
MIS 180

Document information

Uploaded on
December 17, 2024
Number of pages
19
Written in
2024/2025
Type
Class notes
Professor(s)
Jordi conrado
Contains
All classes

Subjects

Content preview

Chapter 8 McGraw-Hill MIS 180: Introduction to Data Analytics with Python II

Programming Basics: You need three things…
1. Input - a way for the computer to get the data it will to work with
2. Processing- instructions about what to do with the data
3. Output- a way to communicate the data with the rest of the world

The Python Integrated Development Environment (IDE): IDLE
- You need to write code that a computer will understand
- IDE or Integrated Development Environment is a software application that includes a
source code editor that translates a programmers code into the format readable by a
computer and includes tools to help the programmer write code
IDLE is an easy-to-use IDE that comes packaged with Python

Download and Install Python and IDLE
- To download and install Python on desktop/laptop, go to
https://www.python.org/downloads/ and select your operating system
- You need a version of Python 3 (used since 2008)
- Python 2 is much older and significantly different from Python 3
- Save the executable file that is downloaded and click on Install
- In pop up window, click Install Now
- To create programs using Python, you need the IDE named IDLE.
This comes with the Python download, but you want easy access
to IDLE (Icon pictured on right)

The IDLE Shell and the IDLE Editor
- IDLE is made up of 1) an interactive shell and 2) a text editor
- Interactive shell- makes it easy to enter and test Python
statements without writing a whole program
- Text editor- use to write longer programs
- When you open IDLE. it opens the interactive shell to type code.
- Enter your code after the >>> prompt, and press Enter
IDLE Shell Example

, - In this example, the user types 3 * 8 and pressed Enter (The result, 24, is displayed)
- Next the user used Print () function, that tells Python to display the what is inside the
parentheses
- After typing print(“Python is fun!”) and pressing Enter, the output is the text,
Python is fun!
- Finally, the user entered an equation requiring a calculation on one line (x = 73 * 4) a
print() command on the next line, and the result was the required text as well as the
result of the calculation
Using the IDLE editor
- Interactive shell makes it easy to experiment with Python code, allowing you to see the
results immediately
- Editor is used to write the entire program you need, not just the segment from the shell
- Python code cannot be written in a word processing program like Word
- IDLE editor works like a simply word processor and has similar features like File, Edit,
and Format menus, but allows to run Python source code
- Once a program is created in the editor and run, the program will run in the shell
IDLE editor features
- Highlights syntax errors (errors occurring from not following Python rules)
- Tells you any runtime errors (errors that occur when a Python statement cannot be
executed as the program is running)
EXAMPLE of IDLE Editor
Photo shows the code for a short program that asks the user to enter their first name and last
initial, then uses that info to create an email address for a college with that email extension
(pythoncollege.edu). In this example, the user’s name is Andy Morris.
Editor is on the left, shell is on the right




Python Basics
- When you run a program, you see the results of your code
- A program needs input, instructions on what to do, and the output
Input
- Input operation- program that takes data from outside source like the program’s user,
Internet, or a file
- When input is required, the program has a prompt that tells the user what is needed
- In Python, a prompt takes the form of an input request, usually stored in a variable

, - Python syntax:
- Variable_name = input (“instruction to user about what to enter”)
Example- program asking the user to enter their name. That value is stored in a variable
named user_name
- User_name = input (“Enter your name: ”)
- Take note of the space between the colon and the ending quotation mark
- Everything within quotes will be displayed when the program runs
- When the prompt has no space after the colon:
input(“Enter your name:”)
Enter your name:Andy
- When the prompt has a space coded before the closing quotation mark:
input(“Enter your name:”)
Enter your name: Andy
Variables
- At least one variable is needed in every program
- Variable- name for a storage location in a computers memory
- Can change value as the program runs
- Value of a variable- what is stored in that location
Example of changing the value of a variable:




Here, there are four variables: num_1, num_2, num_3, and sum
- On line 3, the value of sum is equal to the sum of the values num_1 and num_2, which is
8
- On line 6, the value of sum changes because now it contains the old value (8) PLUS the
value of num_3. The variable sum now has the value of 17




Example of joining variables:
$9.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
seveneleven

Get to know the seller

Seller avatar
seveneleven San Diego State University
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
1 year
Number of followers
0
Documents
7
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions