Save
2ND YEAR - 2ND SEM ( BSCE )
COMPROG
MODULE 4
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Chinee 🌷
Visit profile
Cards (52)
What are the parts of the first program?
Word print,
parentheses
,
quotation marks
, line
View source
What does the word print represent in the program?
It is a
function
name.
View source
What is a function in programming?
A
separate
part of the
computer
code.
View source
What can a function cause in programming?
It can send text to the
terminal
.
View source
How do Python functions relate to mathematical concepts?
They
evaluate
values like mathematical functions.
View source
What forms the function invocation in Python?
Function name,
parentheses
, and
arguments
.
View source
What do quotes do in a string in Python?
They assign a different meaning to the
code
.
View source
What happens to data inside quotes in Python?
It is taken literally, not as code.
View source
What is prohibited in a single line of Python code?
Having more than one
instruction
.
View source
What is an exception to the rule about instructions in Python?
One instruction can spread across
multiple
lines.
View source
What does an empty print() invocation output?
An empty line or a
newline
.
View source
What is the escape character in Python?
The
backslash
(\).
View source
What does the escape character do in a string?
It introduces a
special
inclusion.
View source
What does the letter 'n' after the backslash represent?
Newline
.
View source
What is a newline character?
A
special symbol
urging a new output line.
View source
What must you do to include a single backslash in a string?
Double
it (\\).
View source
What happens if you use a single backslash incorrectly?
It will cause an
error
.
View source
How are arguments separated in the print() function?
By commas.
View source
What role do commas play in the print() function?
They are part of
Python's
syntax.
View source
What does the print() function do with multiple arguments?
Outputs
them all on one line.
View source
How does the print() function separate outputted arguments?
It puts a
space
between them
automatically.
View source
What is a keyword argument in Python?
It
consists
of
a
keyword
,
equal
sign
,
and
value.
View source
Where must keyword arguments be placed in a function?
After the last
positional argument
.
View source
What does the default behavior of the end keyword argument do?
It is implicitly set to
end="\n"
.
View source
What happens when the end argument is set to an empty string?
No
newlines
are sent to the output.
View source
What can the string assigned to the end keyword argument be?
Of
any
length.
View source
What does the sep keyword argument do in the print() function?
It changes how arguments are
separated.
View source
What can the sep argument's value be?
It may be an
empty string
.
View source
Can keyword arguments be mixed in one invocation?
Yes
,
they can be mixed.
View source
What is a literal in programming?
Data
whose
values
are
determined
by
itself.
View source
What are the two types of literals mentioned?
String
and
integer
number.
View source
How are strings and integers stored in memory?
Strings are series of letters; integers are
bits
.
View source
What types of numbers do modern computers handle?
Integers
and
floating-point numbers
.
View source
How do you code negative numbers in Python?
By adding a
minus sign
.
View source
What are floating-point numbers designed to represent?
Numbers with a non-empty
decimal fraction
.
View source
How can you write the value of zero point four in Python?
As
0.4.
View source
What happens if you omit zero in front of or after the decimal point?
You can
omit
it when it's the only digit.
View source
How does Python treat the numbers 4 and 4.0?
4 is an
integer
; 4.0 is a
float
.
View source
What notation can be used for very large or small numbers?
Scientific notation
.
View source
How is scientific notation represented in Python?
Using
E
or e for exponent.
View source
See all 52 cards