ISTM6200 Information Systems Technology Management Assignment
32 Pages1832 Words104 Views
Added on 2021-11-24
ISTM6200 Information Systems Technology Management Assignment
Added on 2021-11-24
ShareRelated Documents
Prof. Wei Chen (wei_chen@gwu.edu)
Dep. of Information Systems & Technology Management
May 27, 2021
Lecture 2: Variables, Expressions, Statements
Dep. of Information Systems & Technology Management
May 27, 2021
Lecture 2: Variables, Expressions, Statements
ISTM6200 / Summer 2021
Class 2: Overview
Learning Objectives:
• Be familiar with variable naming rules
• Be familiar with the basic data types
• Be able to convert data types when necessary
• Understand basic expressions and statements
Today’s Agenda:
• Recap
• Variables and Data Types
• Expressions and Statements
• Basic Built-in Functions
Class 2: Overview
Learning Objectives:
• Be familiar with variable naming rules
• Be familiar with the basic data types
• Be able to convert data types when necessary
• Understand basic expressions and statements
Today’s Agenda:
• Recap
• Variables and Data Types
• Expressions and Statements
• Basic Built-in Functions
ISTM6200 / Summer 2021
Recap: Python as a Language
• Python is an incredibly efficient language: your
program will do more in fewer lines of code than
many other languages would require
• We use Python for many purposes:
▪make games
▪build web applications
▪solve business problems (data problems)
▪...
• The Python community: ask advice from others
who have already solved similar problems
Recap: Python as a Language
• Python is an incredibly efficient language: your
program will do more in fewer lines of code than
many other languages would require
• We use Python for many purposes:
▪make games
▪build web applications
▪solve business problems (data problems)
▪...
• The Python community: ask advice from others
who have already solved similar problems
ISTM6200 / Summer 2021
Recap: Jupyter Notebook
Create a new python file
Recap: Jupyter Notebook
Create a new python file
ISTM6200 / Summer 2021
Recap: Jupyter Notebook
Recap: Jupyter Notebook
ISTM6200 / Summer 2021
Variables
• A variable is a name that represents a value
stored in the computer’s memory, i.e., a storage
space with a symbolic name.
X
• Variables vs. Constants: Fixed values (e.g.,
numbers, letters, strings) are called ``constant’’
since their values do not change.
• The “content” of a variable can be changed:
Example: x = 10
x = “Hello”
print(“The value of x is ”, x)
Variables
• A variable is a name that represents a value
stored in the computer’s memory, i.e., a storage
space with a symbolic name.
X
• Variables vs. Constants: Fixed values (e.g.,
numbers, letters, strings) are called ``constant’’
since their values do not change.
• The “content” of a variable can be changed:
Example: x = 10
x = “Hello”
print(“The value of x is ”, x)
ISTM6200 / Summer 2021
Variables (Cont.)
• A variable is created the first time you assign it a value
Variables must be created before they are used.
Assignment statement: assigns a value to a variable.
Syntax: Variable Name = Variable Value.
Example:
In [1]: x = 5
x
Out[1]: 5
In [2]: Class = “ISTM 6200”
Class
Out[2]: ‘ISTM 6200’
Variables (Cont.)
• A variable is created the first time you assign it a value
Variables must be created before they are used.
Assignment statement: assigns a value to a variable.
Syntax: Variable Name = Variable Value.
Example:
In [1]: x = 5
x
Out[1]: 5
In [2]: Class = “ISTM 6200”
Class
Out[2]: ‘ISTM 6200’
ISTM6200 / Summer 2021
Naming Conventions
• Names can consist letters, numbers and the underscore
character.
• Names must begin with a letter, or underscore
character.
• Names cannot contain spaces.
• Names are case sensitive, e.g., bob ≠Bob ≠BOB
• We cannot use one of Python’s keywords as variable
name!
• Recommended practices when naming variables:
• Meaningful
• Succinct
• Lowercase, concatenate words with underscore
Naming Conventions
• Names can consist letters, numbers and the underscore
character.
• Names must begin with a letter, or underscore
character.
• Names cannot contain spaces.
• Names are case sensitive, e.g., bob ≠Bob ≠BOB
• We cannot use one of Python’s keywords as variable
name!
• Recommended practices when naming variables:
• Meaningful
• Succinct
• Lowercase, concatenate words with underscore
End of preview
Want to access all the pages? Upload your documents or become a member.