stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Introduction to Python Programming Concepts Flashcards | StudBud
Explore
/
Introduction to Python Programming Concepts
Introduction to Python Programming Concepts
30 terms
·
StudBud Administration
·
43 plays
An introduction to Python Programming Concepts
Flashcards
30 cards
F
Practice quiz
P
Host live
L
Questions
30
Answers
1
What data type is used for whole numbers, text and decimals... pick the correct sequence.
integer, string, float
string, integer, float
string, float, integer
type, string, float
2
Who invented Python?
Albert Einstein
Guido van Rossum
Isaac Newton
Werner von Braun
3
After these statements, what is value of num? num= 104.9876543 num=round(num, 3)
104.987
104
105
104.988
4
After these statements, what is value of num? num= 38.73 num=int(num)
38.73
38
38.7
39
5
Are you ready for the test tomorrow?
Yes, I will be getting a 100%. Guaranteed.
Maybe. I will study very hard tonight.
No, I really need to study my notes tonight.
I'm confident, but I will study smart tonight.
6
What control code moves output over by an amount of spaces so you can make columns?
\f
/t
\n
\t
7
What is this output? print("11" + "11")
22
syntax error
1111
121
8
What function stores text values?
float()
str()
text()
round()
9
Which is NOT a valid identifier?
my Dog
myDogSpot
myDog
my_Dog
10
What is WRONG with the following statement that assigns value 25 to variable x..... 25 = x
x is an invalid name for an identifier
A variable can never be on the right side of the =
25 is invalid name for an identifier
Variable receiving value must be on left side of =
11
What is this output? print(11 + 11)
121
syntax error
22
one hundred twenty
12
Is this a valid statement? gross-pay = 9000.65
Yes
No
13
Which identifiers are LEGAL?
total_salary and savings_rate
total-salary and savings rate
if or while or class
total salary and savings_rate
14
What will print? a,b,c = 1,2,3 print(a,b,c)
1,2,3 - it will print the assigned values
syntax error
nothing will print
a,b,c - it will print the variables
15
What is the value of z in this sequence? x = 4, y = 5 , z = y - x , print(z)
1
9
5
4
16
After these statements, what is value of num? num= 1155.9876014 , num=round(num1, 3)
1156
Syntax Error- num1 not defined
1155
1155.988
17
What does this do? \t
Python backspaces 1 character
Python tabs one position over
Python gives a syntax error
Python makes a new line
18
What type of variable is mortgage_rate? mortgage_rate = .045
floating point or float
string or str
integer or int
type or typ
19
How can you put comments about your code into Python to help yourself?
use /comment at beginning of line of code
use # at beginning of line of code
use % at beginning of line of code
use \** at beginning of line of code
20
What does the equals sign (=) mean in Python for: x = 25
variable x equals integer 25
variable x is assigned value of 25
21
Which statement is correct to know the type of variable hello?
print(type-hello)
print_type(hello)
print(hello)
print(type(hello))
22
Which is not an integer?
-17.25
99
0
1003
23
What is value of x in this sequence? x = 4 , y = 5, z = y - x, x = 19, print(x)
5
19
1
4
24
What will print after this line is executed: print("\n")?
"n"
Python will move one tab over on the screen
n
Python will produce a blank line
25
What prints here? num1 = 10.25 , print(type(num1))
syntax error
<type int>
<type float>
type <str>
26
Is this a valid statement? What is output? mortgage = 10,314.68 print(mortgage)
Yes, output will be 10,314.68
No, syntax error appears
Yes, output will be 10314.16
Yes, output will be 10 , 314.68
27
What will print here? num6 = 984 , print(type(num6))
type <str>
<type float>
syntax error
<type int>
28
What prints to the screen? print(10 + 1,000 + 40)
syntax error
11, 40
1050
10 + 1,000 + 40
29
What will the print output be? x = 9, print(9), print("9")
gives a syntax error
prints 9 as an integer twice
prints 9 as a string once
prints 9 as an integer and prints 9 as a string
30
What will print to the screen: print(type("house"))
house
<type 'str'>
<type 'string'>
<type 'int'>