[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

2 / 40

2.

 Select the correct example of complex datatype in Python

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

3 / 40

3.

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

4 / 40

4. An array is a special variable, which can hold more than one value at a time

5 / 40

5. 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

6 / 40

6. You can use the pop() method to remove an element from the array

7 / 40

7. Comments can be used to explain Python code.

8 / 40

8. 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

9 / 40

9. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

10 / 40

10.

Which function overloads the >> operator?

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

11 / 40

11. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

12 / 40

12. 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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

17 / 40

17. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

18 / 40

18. print() function is often used to output variables.

19 / 40

19. Most recent major version of Python is Python 3

20 / 40

20.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

21 / 40

21. Python can connect to database systems.

22 / 40

22.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

23 / 40

23.

What is the data type of print(type(0xFF))

24 / 40

24. We can combine strings and numbers by using the format() method

25 / 40

25. Bitwise operators are used to compare (binary) numbers

26 / 40

26. Comparison operators are not  used to compare two values

27 / 40

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

28 / 40

28.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

29 / 40

29. Pascal Case
Each word starts with a capital letter:

30 / 40

30. 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

31 / 40

31. Python is an interpreted programming language

32 / 40

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

33 / 40

33. What will be the output of the following Python code?

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

34 / 40

34. The format() method takes unlimited number of arguments

35 / 40

35.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

36 / 40

36. With the for loop we can execute a set of statements

37 / 40

37.

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.

38 / 40

38. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

39 / 40

39. You can return a range of characters by using the slice syntax

40 / 40

40.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

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.