Save
computer science
mock
programing
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
emily d
Visit profile
Subdecks (8)
list
computer science > mock > programing
12 cards
strings
computer science > mock > programing
16 cards
iteration
computer science > mock > programing
13 cards
selection
computer science > mock > programing
23 cards
casting
computer science > mock > programing
20 cards
operators
computer science > mock > programing
69 cards
data types
computer science > mock > programing
11 cards
input , variable, output
computer science > mock > programing
21 cards
Cards (230)
procedure
prints
data
function
returns
data
add
= +
subtract
= -
divide
= /
multiply
=
*
modulus
(
remainder
)= %
integer division
(round down)=
//
power
=**
!=
not equal to
selection
=
decision
(select)
What does the
function
print()
do in
Python
?
Displays text on the screen
View source
What is the purpose of the
input()
function in Python?
It prompts a
user
to
enter
data
via the keyboard
View source
What does the int() function specify in
Python
?
That the data you want is an integer(number)
View source
What does the
str
() function specify in
Python
?
That the data you want is a string
View source
What does the
float
() function specify in
Python
?
That the data you want is a float
View source
What is the
function
of
help()
in
Python
?
It provides a built-in help system
View source
How would you use the
help
() function in Python?
By typing help(
print
) in the shell
View source
What does the
len()
function do in
Python
?
Tells you the length of an object
View source
How can you test the
len
() function in
Python
?
By trying len("duuude") in the
shell
View source
What does the
type()
function do in Python?
Tells you the type of an
object
View source
How can you test the
type
() function in
Python
?
By trying type(1) or type(1.1) in the shell
View source
What is the purpose of the
range()
function in
Python
?
It allows a range of numbers to be used
View source
How is the
range
() function frequently used in Python?
With a
for loop
View source
What does the
list()
function do in
Python
?
Can take a string and convert it to a list
View source
What are the main functions discussed in the study material?
print
(): Displays text on the screen
input
(): Prompts user to enter data
int
(): Specifies integer data
str
(): Specifies string data
float
(): Specifies float data
help
(): Built-in help system
len
(): Tells length of an object
type
(): Tells type of an object
range
(): Allows a range of numbers
list
(): Converts a string to a list
View source
Write a
program
that reads the
base
and the
height
of a right-angled triangle and prints the
area
.
height=int(
input
())
base=int(input())
print(height*base/2)
Write a
program
that greets the person by printing the word "Hi" and the
name
of the person
name =
input
()
print("Hi",(name))
What is the main component of a computer program?
Sequence
View source
What does sequence refer to in programming?
Ordered list of
instructions
in a program
View source
What is iteration in programming?
Looping
or repeating of code
View source
How would you print "Hello" 5 times using iteration?
By
looping
the print
instruction
5 times
View source
What is selection in programming?
Making
decisions
in code
View source
What does a condition do in selection?
Checks which
direction
the selection code takes
View source
What is a variable used for in programming?
To store
values
in
code
View source
How does a variable work with user input?
Stores user input for
later
use
View source
What is decomposition in programming?
Breaking down
a
large
problem into
smaller
problems
View source
Why is decomposition useful?
Makes it easier to solve
complex
problems
View source
What is abstraction in programming?
Removing
unnecessary
information
from a problem
View source
How does abstraction help in programming?
Focuses on the
core
issue of a problem
View source
See all 230 cards