Python Summative 1 Flashcards
One of the most popular programming languages
Python
The strengths of Python are the following:
Ease of Use
Readable
Complete
Cross-platform
Free
familiar constructs (loops, arrays, and so forth)
Ease of Use
easier it is to debug, maintain, and modify.
Readable
its standard library comes with modules
Complete
Windows, Mac, Linux, UNIX, and so on.
Cross-platform
developed under the open-source model
Free
Many applications of Python
data science, scientific research, web development, etc.
It is recommended to install Python that comes with the_______
Anaconda distribution.
Browser-based application that provides an environment for running and testing Python codes
Jupyter
ideal for documentation purposes which make both ease of sharing and code replicability possible
Jupyter
When launching Jupyter, notice that:
opens a browser window
command line interface (a.k.a. Jupyter Notebook server)
This enables users to access Jupyter Notebook on their localhost
command line interface (a.k.a. Jupyter Notebook server)
The other component of Jupyter is a dashboard which is accessible via a web browser
Dashboard
The URl is ________ which indicates its connection to the Jupyter Notebook Server.
localhost:8888
When commands were executed, it is actually executed in the _________
Notebook Server
The _____ displays files and folders that are in the home directory
dashboard
Allows to create a folder to where Python notebooks were placed and then, proceed with creating a new Python notebook
Dashboard
It is a place to write in code or text
Cell
A cell is indicated by a _____, which is enclosed in a box
cell block
Cell types:
code cell
markdown cell
The _______ is intended for typing in and run python codes.
code cell
Printing hello world in a code cell requires ______
print()
Markdown cell allows to create formatted text:
a header for a section by using #
header for a subsection by using ##
bold text by enclosing it in two asterisks
make sure to first select ______ from the pull-down list
‘Markdown’
Jupyter functions in mainly two modes:
edit mode
command mode
is indicated by a green line in the leftmost part of an active cell
edit mode
In ______, we can type in our codes or markdown text
edit mode
is indicated by a blue line in the leftmost part of an active cell
Command mode
What is the output of the given code:
print (“Hello World!”)
Hello World!
Jupyter assigns an _____ to remember which codes are executed first
execution number
This number is reflected in the rightmost part of executed code cells
Execution Numbers
print()
print or output whatever is inside the open and close parentheses.
“Hello world!” is an example of a data type called ____
string
Any characters enclosed in _______ will be treated by Python as a string
quotations (either single or double quotation)
Python can be used to evaluate numerical expression in a code cell
Python as Calculator
With print(), joining plain text with _______ is possible
values of numerical expression
What is the output of the given code:
print(“16 x 24 = “, 16*24)
16 x 24 = 384
Basic Numerical Operations
addition( + )
subtraction ( - )
multiplication ( * )
division ( / )
exponentiation (**)
modulo ( % )
integer division ( / /)
As in calculators, ______ is used for expressions with many operators
PEMDAS
What is the output of the given code:
3+4*5
23
What is the output of the given code:
(3*4)/(2**2 + 4/2)
2
an external python file that can be imported to a current python file.
Module
In Jupyter, to have a quick view of the available functions in the module, type the ________
module name + dot + TAB
These mathematical functions are executed via
___
math .function_name
The inputs to them are always placed ______ that are connected to the function name
inside of parentheses
Aside from numerical expressions, Python can be used to compare values
Logical Operators
What is the output of the given code:
5 > 4
TRUE
What is the output of the given code:
51.34 < 24.78
TRUE
What is the output of the given code:
(1+3) == (2 + 2)
TRUE
What is the output of the given code:
(1+3) != (2+2)
FALSE
The keywords ______ when dealing with multiple comparisons
and
or
The keyword _____ is used to denote negation of a comparison result
not
Boolean bool as data type can be ____
printed
What is the output of the given code:
(5>4) and (4<5)
TRUE