[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python  was created by Guido van Rossum, and released in 1999.

2 / 40

2.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

3 / 40

3. To insert characters that are illegal in a string, use an escape character

4 / 40

4. The length of an array is always one more than the highest array index.

5 / 40

5.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

6 / 40

6. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

7 / 40

7.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

8 / 40

8. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

9 / 40

9. Python is an interpreted programming language

10 / 40

10. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

11 / 40

11. You can have if statements inside if statements, this is called nested if statements.

12 / 40

12. You can also use the remove() method to remove an element from the array

13 / 40

13. Python can be used to handle big data and perform complex mathematics.

14 / 40

14. Official site of python is www.python.org

15 / 40

15.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

16 / 40

16. Comparison operators are not  used to compare two values

17 / 40

17. + operator is used  to get output of multiple variables

18 / 40

18.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

19 / 40

19. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

20 / 40

20. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

21 / 40

21.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

22 / 40

22. Indentation refers to the spaces at the beginning of a code line.

23 / 40

23. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

a) Hello
b) Know Program
c) Compiled Successfully, No Output.
d) Error

24 / 40

24. Comments can be used to explain Python code.

25 / 40

25. Variables that are created outside of a function

26 / 40

26. The for loop does not require an indexing variable to set beforehand

27 / 40

27.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

28 / 40

28. Python has various versions available

29 / 40

29. You can also have an else without the elif

30 / 40

30. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

31 / 40

31.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

32 / 40

32. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

33 / 40

33. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

34 / 40

34. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

35 / 40

35. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

36 / 40

36. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

37 / 40

37. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

38 / 40

38. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

39 / 40

39. Comments can’t be used to prevent execution when testing code.

40 / 40

40.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

Exit



[hurrytimer id=”2250″]
[wooct_product]

Wrong shortcode initialized


You must log in to see your results.



Wrong shortcode initialized


There are no questions atteched yet.





[ays_quiz_leaderboard id=”Your_Quiz_ID” from=”Y-m-d H:i:sa” to=”Y-m-d H:i:s”]

Category:


Wrong shortcode initialized


[WATU 1]

You must log in to see your results.