[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python will give you an error if you skip the indentation

2 / 40

2. The len() method to return the length of an array

3 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

4 / 40

4. Python has various versions available

5 / 40

5. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

6 / 40

6. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

7 / 40

7. Python is an interpreted programming language

8 / 40

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

9 / 40

9.

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

10 / 40

10. To write and execute code in python, we first need to install Python on our system.

11 / 40

11. Comparison operators are not  used to compare two values

12 / 40

12.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

13 / 40

13. Is there any comments in  following codes

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

 

14 / 40

14. Python relies on indentation?

15 / 40

15. Arithmetic operators are used with numeric values to perform common mathematical operations

16 / 40

16.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

17 / 40

17. The list’s remove() method only removes the first occurrence of the specified value.

18 / 40

18.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

19 / 40

19.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

20 / 40

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

21 / 40

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

22 / 40

22.

Which function overloads the >> operator?

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

23 / 40

23. A variable name cannot start with a number

24 / 40

24.

 Select the correct example of complex datatype in Python

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

25 / 40

25.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

26 / 40

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

27 / 40

27. Comments can be used to make the code more readable.

28 / 40

28.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

29 / 40

29. Camel Case
Each word, except the first, starts with a capital letter:

30 / 40

30. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

31 / 40

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

32 / 40

32.

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

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

33 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

34 / 40

34.

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

35 / 40

35. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

36 / 40

36. Most recent major version of Python is Python 3

37 / 40

37. With the break statement we can stop the loop even if the while condition is true

38 / 40

38. python has two primitive loop commands:

  • while loops
  • for loops

39 / 40

39. Python allows you to extract the values into variables.

40 / 40

40.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

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.