INSC 260 :Module 1 & 2
How to write a comment
''' '''
Example of random.randrange(6)
0...6
When was Python implemented?
1990
Basic computer program
4 instructions
compiled languages
A compiler program translates source code (what the programmer writes) to machine language (object code) A linker program puts various object code files together into an executable program (or other target type, like a DLL) C and C++ are compiled languages (more closer to AI)
compiler
A computer program created to read an entire program and convert it into a lower-level language and ultimately to assembly language used by the processor.
interpreted language
A computer programming language, such as Python, JavaScript, and Ruby, that requires a program called an interpreter to execute the instructions written in the source code each time the application is run (more closer to human)
machine instruction
A series of 0s and 1s, stored in memory, that tells a processor to carry out a particular operation like a multiplication.
integrated circuit
A thin slice of silicon that contains many solid-state components.
syntax error
An error in a program that makes it impossible to parse — and therefore impossible to interpret.
runtime error
An error that does not occur until the program has started to execute but that prevents the program from continuing.
value error
An invalid value is used - can occur if giving letters to int().
type error
An operation uses incorrect types - can occur if adding an integer to a string.
Python code
Code written in the Python programming language.
deep work
Dedicating long, uninterrupted periods of time to a task.
output devices
Devices that enable the computer to give the user the results of the processed data.
the types of declarative
Functional, Logic, and Mathematical
How "close" are you to machine?
Interpreted language Compiled language Assembly Binary
MIPS
Millions of Instructions Per Second. A way of measuring processor speed.
Weak type(dynamically)
Not required variable declared before referencing (Python,PHP,R)
Python is...
Object-oriented
bug
Part of a program that does not work correctly.
Assembly Language
Programming language that has the same structure and set of commands as machine languages but allows programmers to use symbolic representations of numeric machine code.
Integrated Development Environment (IDE)
Provides a developer with a way to create a program, run the program, and debug the program all within one application.
IDE vs. Interpreter
Python Program Python Interpreter
program paradigms
Representations of approaches to programming that offer explanations of the processes involved.
Tips for new coders
Run codes more than once. You will usually see only one at a time.
processor
The component of a computer that follows instructions
indentation error
The lines of the program are not properly indented.
Programming
The process of designing, mathmetical principles, writing, testing, debugging, and maintaining the source code of computer programs Computer = language Human = Teach
name error
The program tries to use a variable that does not exist.
Python interpreter
a computer program that executes code written in the Python programming language
memory RAM
a form of computer data storage. A random-access memory device allows data items to be read and written in approximately the same amount of time regardless of the order in which data items are accessed.
computer disk
a magnetic disk on which computer data is stored
line
a row of text
SQL
a special-purpose programming language for accessing and manipulating data stored in a relational database
dynamically typed
a variable's type may change while a program executes, usually based on what is assigned to the variable
Which of the following statements has a syntax error?
age + 3 = years
application
another word for a program or software
Basic Input/Output System (BIOS)
built-in program which initializes computer hardware and launches the operating system when the computer starts Print= string laterals and newline character Input= keyboards
Drawbacks from Python code
difficult to read the code than other programming languages.
statically typed
each variable's type must be declared and cannot change while the program runs
input devices
enable the user to input data and commands into the computer
intepreter
executes computer code
advantages and disadvantages of assembly
faster than compiled and CPU
advantages and disadvantage of compiled languages
faster, harder to read, static type checks
abstraction
ideas of how coding is giving me results in form of feedback.
common of paradigms
imperative declarative
transistors
invented by Bell Laboratories in 1947, these tiny pieces of technology, which receive and amplify radio signals, make portable radios possible
memory circuit
is used to keep relay energized
strong typed language (which is what java is)
means variables need to be defined before we use them
Example of print statement
print(f'{"USA":s} had {8:f} billion people in {2022:d}')
the types of imperatives
procedural and object-oriented
puts output on line
code
represents computer program
Advantages and disadvantages of interpreted languages
slow, quick writing, platform independence,
Cache computer
small amount of RAM on own chip
type
strings and integers int= integer of an number
prompt
tells that the interpreter accepted the code
string
text enclosed as quote
Moore's law
the observation that computing power roughly doubles every two years.
storage
the process of retaining encoded information over time
bits
the smallest unit of data in a computer
Coding
the systematic assignment of numbers or letters to items to classify and organize them
Logistics
those activities that focus on getting the right amount of the right products to the right place at the right time at the lowest possible cost
The clock of a computer system is the:
timing device that produces electrical pulses to synchronize the computer's operations.
switches
used to turn electricity on and off
logic errors
when compiler or interpreter is able to run program but program does something unexpected
instruction programs
x+y+z/3