Lecture 2: Core elements of a program Flashcards
What IDE stands for?
Integrated Development environment
What is the IDE of Python?
IDLE
What is an IDE?
an integrated development environment includes a specialized text editor that provides highlights, auto-completion, and smart indent. it includes a shell editor.
what is the shell?
it is the environment that actually interprets the python code. it includes a syntax highlighter and a debugger.
what are the “objects”?
everything in python is an object, including the code. objects have type.
what is the “type” of an object?
the type tells us the kind of object it is and what we can do with it.
what are the two kinds of types?
scalar & non-scalar
what are the scalar types?
they are the atoms of the programming language, they are indivisible. There’s the notion of a literal for every type, which is how we type it. they are divided into:
Integer, floats, booleans, none.
What is a float type?
they are the type that corresponds to the real numbers
Are floats the same thing as real numbers?
No
What is a float?
A float is a computer scientist approx to real numbers but not quite the same. You can pretend a floating point number is real but not always.
what is a boolean?
they are statements that are either true or false.
What is a none type?
they are used when you want to put in something temporarily.
What is scalar type that is not included in python?
Char or characters
what python uses instead of Char or characters?
Strings or Str
What are the literals?
they are the things we can literally scribe in python, for example putting abc.
what is an expression?
it is a sequence of operands and operators
what are the operands?
they are objects
what is concatenation
it is the combination of two or more strings to form a single string
what is an overloaded operator?
they have a meaning that depends on the type of the operands
what does the ‘#’ mean in a line in a python script [program]?
that it is a comment and will not execute
how do you execute a script or line of script in the shell?
using the print command
what is a script [program]?
it is a sequence of commands that tell the interpreter to do something.
what is an assignment statement?
it is used to give [binds] a value or a name or an identifier to a variable. it is also used to store value in the variables.
what is a variable[in python]?
a name for an object
what is the purpose of a comment[in python]?
that the program[script] is easier to read.
what is the difference between print and raw input?
print is for the output and raw input is for the input
what is a straight-line program?
its a sequence of commands executed one after the other without any deviations once
what is a conditional statement?
it is the most primitive kind of program test, conditional statements use the words if and else
what is a branching program?
its a program that
what is a branching program?
its a program that
what is a branching program?
It’s a sequence of commands executed independently and simultaneously in an if-or-else manner. just like straight-line programs each command is executed at least once
what is a looping construct?
it is a programming structure that allows a block of code to be repeated multiple times based on certain conditions