NEW
Font size
WorksheetsPython Review - PLTW CSE / Codecademy
Total questions: 53
Worksheet time: 29mins
Find T ?
T=144 / 2 + 5 * 9 - ( 8 -3 )
106
688
112
684
def.number (r1 , r2)
sum = r1 / r2
return sum
a = number (r2 = 15 , r1 = 10)
2 / 3
3 / 2
error
2
Find the Output:
Item = {"ECE" , "CSE" , "EEE" , "CIVIL"}
Item.add (2,"MECH")
print(Item)
{ "ECE" , "MECH" , "CSE" , "EEE" , "CIVIL" }
{ "ECE" , "CSE" , "MECH" , "EEE" , "CIVIL" }
{ "ECE" , "CSE" , "EEE" , "CIVIL" }
{ "ECE" , "CSE" , "EEE" ,"MECH" , "CIVIL" }
what is the output of the following code ?
var1 = 1
var2 = 2
var3 = "3"
print (var + var2 var3)
Error. Mixing operators between numbers and strings are not supported
6
33
123
Which of the following function convert a string to a float in python ?
float(X)
int(x[,base])
long(X[,base])
str(X)
what is the output of the following programing ?
X = [ 'ab' , 'cd' ]
for i in X:
i.upper()
print (x)
[ 'AB' , 'CD' ]
[ 'ab' , 'cd' ]
[ AB , CD ]
ERROR
what will be the output of the following python code snippet ?
not (10 < 20) and not (10 > 30 )
TRUE
FALSE
Find the output ?
a = True
b = False
c = False
if a or b and c :
print "INFYTQ"
else:
print "infytq"
infytq
INFYTQ
ERROR
A(n) integer is:
A programming statement that directs control flow - it uses BOOLEAN expressions to make a choice between different paths (IF (condition) THEN (path1) ELSE (path2)
A precise number by including values after the decimal place
A whole number, it does not have any digits after a decimal.
A data type that can have only 2 values - TRUE or FALSE
A(n) variable is:
An action (such as clicking a button) or occurrence (receiving a text message) that happens during runtime that will trigger a response or behavior by the software.
An object such as a number or word. A _____ is an expression that cannot be evaluated any further. Variables are evaluated to a final ____ before operators (arithmetic, relational, or logical) are then used on them.
A type of variable that holds text (characters, numbers, punctuation or math symbols). Uses quotes to tell the computer to not treat what is inside the string (inside the quotes) as code.
The smallest unit of data storage that a program can use.
What does Modulo do
Gives the difference of two numbers
Does simple arithmetic
Give the product when mutiplying
Returns the reminder when divding
What does the following code statement mean "from .models import Question"?
The code statement allows the views.py file to access to your Question data type defined in the models.py file.
The code statement allows the views.py file access to your Question data type defined in the urls.py file.
The code statement allows the views.py file access to your Question data type defined in the admin.py file.
The code statement allows the views.py file access to your Question data type defined in the views.py file.
print(Hello world!)
print("Hello world!")
Print("Hello world!")
print(3+4)
print(3*4)
print(3*4+5)
name = 'Dave'
print (name)
name = 'Dave'
greeting = "Good morning" + name
print (greeting)
print("Hello world!\nHello world!")
Hello world!
print("Hello" + str(2) + "world!")
What does the following code do? myAge = int (myAge)
Converts the var (variable) myAge to a string
Converts the var (variable) myAge to a integer
Converts the var (variable) myAge from a integer to a string
Converts the var (variable) myAge to if statement
people = ["John", "Rob", "Bob"]
print (people[1])
what would this result be?
people = ["John", "Rob", "Bob"]
print (people[-1])
what would this result be?
people = ["John", "Rob", "Bob"]
print (people[4])
what would this result be?
