Q.217.Parameters of a function can be defined
Q.217.Parameters of a function can be defined
Q.227.If List=[‘A’,5,6,’C’,8,’L’,’C’,’N’] the method to print every even-index element from the list is
Q.227.If List=[‘A’,5,6,’C’,8,’L’,’C’,’N’] the method to print every even-index element from the list is
Q.277.. Is Python code compiled or interpreted?
Q.277.. Is Python code compiled or interpreted?
Q29
Find the mistake:
user_input = input("Enter a number: ");
print("You entered: ", int(user_input))
Q29
Find the mistake:
user_input = input("Enter a number: ");
print("You entered: ", int(user_input))
Q28
Identify the error:
print("Hello World!"))
Q28
Identify the error:
print("Hello World!"))
Q27
Pseudocode:
Initialize a variable with "Python", print first and last character
Q27
Pseudocode:
Initialize a variable with "Python", print first and last character
Q26
Pseudocode:
Print each element in list [1, 2, 3] with a space in between
Q26
Pseudocode:
Print each element in list [1, 2, 3] with a space in between
Q25
Pseudocode:
Ask user for number, multiply by 2, print result
Q25
Pseudocode:
Ask user for number, multiply by 2, print result
Q24
What is the output of
print("Hello", end='@');
print("World")
Q24
What is the output of
print("Hello", end='@');
print("World")
Q23
What will be the output of
print("Python", "Programming", sep="-")
Q23
What will be the output of
print("Python", "Programming", sep="-")
Q22
What does the sep parameter do in the print() function?
Q22
What does the sep parameter do in the print() function?
Q.226.If List=[‘A’,5,6,’C’,8,’L’,’C’,’N’] then the method to extract[‘A’,5,6,’C’] from the list is
Q.226.If List=[‘A’,5,6,’C’,8,’L’,’C’,’N’] then the method to extract[‘A’,5,6,’C’] from the list is
Q.225.The method to extract the last element of a list is
Q.225.The method to extract the last element of a list is
Q.224.Elements of a list are
Q.224.Elements of a list are
Q.219.
For the given program
def add(num1=2,num2=3):
return num1+num2
If we call the function as add(4) the output should be
Q.219.
For the given program
def add(num1=2,num2=3):
return num1+num2
If we call the function as add(4) the output should be
Q.278.What is the order of precedence in Python?
Q.278.What is the order of precedence in Python?
-
-
-
-
Q.220.Which one of the following is the correct way of calling a function
Q.220.Which one of the following is the correct way of calling a function
Q.222.You can also create your own functions, these functions are called
Q.222.You can also create your own functions, these functions are called
Q.223.What is a recursive function?
Q.223.What is a recursive function?
Q.224.If return statement is not used inside the function, the function will return
Q.224.If return statement is not used inside the function, the function will return
Q30
What is the purpose of an if statement in Python?
Q30
What is the purpose of an if statement in Python?
Q31
In Python, which keyword is used to check additional conditions if the previous conditions fail?
Q31
In Python, which keyword is used to check additional conditions if the previous conditions fail?
Q32
What will happen if the condition in an if statement in Python evaluates to False?
Q32
What will happen if the condition in an if statement in Python evaluates to False?
Q33
Which of the following is a valid conditional statement in Python?
Q33
Which of the following is a valid conditional statement in Python?
Q21
What is the purpose of the end parameter in the print() function?
Q21
What is the purpose of the end parameter in the print() function?
Q20
Which function in Python is used to display data as output?
Q20
Which function in Python is used to display data as output?
Q6
Which of the following is a mutable data type in Python?
Q6
Which of the following is a mutable data type in Python?
Q5
Which of these data types does Python not natively support?
Q5
Which of these data types does Python not natively support?
Q4
Python is a:
Q4
Python is a:
Q3
Which of the following is a valid Python comment?
Q3
Which of the following is a valid Python comment?
Q2
Which version of Python removed the print statement?
Q2
Which version of Python removed the print statement?
Q1
Python is known as:
Q1
Python is known as:
Q.283. Which of the following is used to define a block of code in Python language?
Q.283. Which of the following is used to define a block of code in Python language?
Q.282.Which of the following is not a core data type in Python programming?
Q.282.Which of the following is not a core data type in Python programming?
Q.281.Which of the following is the use of the id() function in Python?
Q.281.Which of the following is the use of the id() function in Python?
Q.280. Which of the following functions is a built-in function in Python?
Q.280. Which of the following functions is a built-in function in Python?
Q7
What data type would you use to store a whole number in Python?
Q7
What data type would you use to store a whole number in Python?
Q8
Which of the following is not a Python built-in data type?
Q8
Which of the following is not a Python built-in data type?
Q9
What will be the data type of the variable x after this assignment:
x = 3.5?
Q9
What will be the data type of the variable x after this assignment:
x = 3.5?
Q19
What is the default type of data returned by the input() function in Python 3.x?
Q19
What is the default type of data returned by the input() function in Python 3.x?
Q18
Which function is used to read input from the console in Python?
Q18
Which function is used to read input from the console in Python?
Q17
Find the mistake:
x = (1, 2, 3);
x[1] = 4;
print(x)
Q17
Find the mistake:
x = (1, 2, 3);
x[1] = 4;
print(x)
Q16
Identify the error in this code:
x = [1, 2, 3];
print(x)
Q16
Identify the error in this code:
x = [1, 2, 3];
print(x)
Q15
Evaluate this pseudocode:
Set x = [1, 2, 3];
If x is a list, print length of x, else print "Not a list"
Q15
Evaluate this pseudocode:
Set x = [1, 2, 3];
If x is a list, print length of x, else print "Not a list"
Q14
Pseudocode:
Variable
x = "Python";
Check if x is a string,
if yes
print "String",
otherwise
"Not a String"
Q14
Pseudocode:
Variable
x = "Python";
Check if x is a string,
if yes
print "String",
otherwise
"Not a String"
Q13
What will be the output of the following pseudocode?
Initialize x as 10;
If x is of type int,
print "Integer"
else
print "Not Integer"
Q13
What will be the output of the following pseudocode?
Initialize x as 10;
If x is of type int,
print "Integer"
else
print "Not Integer"
Q12
What does the following code output:
x = [1, 2, 3];
print(type(x) == list)
Q12
What does the following code output:
x = [1, 2, 3];
print(type(x) == list)
Q11
What is the output of the following code snippet:
print(type("Hello, World!"))
Q11
What is the output of the following code snippet:
print(type("Hello, World!"))
Q10
Which of the following is an immutable data type?
Q10
Which of the following is an immutable data type?
Q.279. Which of the following is not a Python data type?
Q.279. Which of the following is not a Python data type?