Numbers, Strings and Lists
Numbers, Strings and Lists
HORT 530 Lecture 9 Instructor: Kranthi Varala
Variables and Objects
? Variables are the basic unit of storage for a program.
? Variables can be created and destroyed.
? At a hardware level, a variable is a reference to a location in memory.
? Programs perform operations on variables and alter or fill in their values.
? Objects are higher level constructs that include one or more variables and the set of operations that work on these variables.
? An object can therefore be considered a more complex variable.
Classes vs. Objects
? Every Object belongs to a certain class. ? Classes are abstract descriptions of the
structure and functions of an object. ? Objects are created when an instance of the
class is created by the program. ? For example, "Fruit" is a class while an "Apple"
is an object.
Core data types
? Numbers ? Strings ? Lists ? Dictionaries ? Tuples ? Files ? Sets
Variable names
? Rules for variable names
? Must begin with a letter or an underscore ? May only contain letters, numbers and underscore
? Variable names are case-sensitive i.e.,
? var Var vAr vaR VAr vAR VaR VAR
? Good practices for names:
? Pick a name that implies the value it should contain.
? Eg., UserName instead of user or name or n.
? Use descriptive names (not too long)
? Eg., log2Expression, currentLine
? Use a consistent style.
? UserName OR user_name
? Examples of Bad variable names:
? Test, temp, var, x, y, z, i, j ....
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- ppyytthhoonn ssttrriinnggss tutorialspoint
- strings in python cs department
- strings ncert
- strings in python marquette university
- numbers strings and lists purdue university
- python strings methods
- numbers strings and lists
- sequences strings lists and files
- lists and strings calvin university
- strings lists sets dictionaries and files 4 1 strings
Related searches
- new york lottery numbers midday and evening
- polio numbers with and without the vaccine
- lists of strengths and weaknesses examples
- ordered and unordered lists html
- powershell concatenate strings and variable
- replacement bow strings and cables
- bear bow strings and cables
- home organization lists and charts
- lucky numbers today and tomorrow
- c lists and arrays
- lists of lists epa
- matlab join strings and variables