stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Basic Python Questions Flashcards | StudBud
Explore
/
Basic Python Questions
Basic Python Questions
15 terms
·
StudBud Administration
·
70 plays
A quiz on Python programming concepts taught in NC BP14 Python Programming I
Flashcards
15 cards
F
Practice quiz
P
Host live
L
Questions
15
Answers
1
Which command will correctly ask the user for their age?
How old are you = input()
input("How old are you?") = age
age = input("How old are you?")
age = input(How old are you?)
2
Which command will display the text 'Hello world!' on the screen?
print = "Hello world!"
print("Hello world!")
print(Hello world!)
print "Hello world!"
3
what data type is 3.95?
String
Character
Float
Integer
4
What would the output of this code be if the user entered the value 70?
Distinction
Merit
Pass
Fail
5
What effect does the # character have?
It does nothing, Python ignores this character.
Tells Python to ignore the rest of the line.
Tells Python to tweet when this line of code gets run.
Tells Python that this is a really important line of code.
6
How would we fix this code?
Remove the '='
Remove the ( ) around name
Make 'Name' lower case
Removed the ' ' from around Bob
7
What is a variable?
A coding technique
A special file
A piece of data that can change
A piece of data you cannot change
8
What is the result of this command? print ("5" + "3")
53
"8"
"5" + "3"
8
9
15. Which of these tests whether the variable x is the same as 'Hello'?
x == "Hello"
x != "Hello"
x <> "Hello"
x = "Hello"
10
in the line of code below what is
myName
?
Method
String literal
Variable
Function
11
What does the input() function do?
It allows users to change the program
It allows users to enter data
It allows a user to solve a task
It converts data types
12
Which function will convert a string containing only digits into a number?
chr()
str()
int()
ord()
13
Which function will convert a number to a string?
chr()
str()
int()
ord()
14
Which decision statement will be triggered if the variable x is less than 20?
if x < 20:
if x == 20:
if x > 20:
if x <> 20:
15
What would the outcome of this program be?
Nothing, it won't run due to errors in the code
25
17
int2int3*int5