Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
College aantekeningen

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

Beoordeling
-
Verkocht
-
Pagina's
19
Geüpload op
17-12-2024
Geschreven 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

Meer zien Lees minder
Instelling
MIS 180
Vak
MIS 180

Voorbeeld van de inhoud

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:

Geschreven voor

Instelling
MIS 180
Vak
MIS 180

Documentinformatie

Geüpload op
17 december 2024
Aantal pagina's
19
Geschreven in
2024/2025
Type
College aantekeningen
Docent(en)
Jordi conrado
Bevat
Alle colleges

Onderwerpen

$10.49
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kan je een ander document kiezen. Je kan het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper
Seller avatar
seveneleven

Maak kennis met de verkoper

Seller avatar
seveneleven San Diego State University
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
-
Lid sinds
1 jaar
Aantal volgers
0
Documenten
7
Laatst verkocht
-

0.0

0 beoordelingen

5
0
4
0
3
0
2
0
1
0

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen