[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

3 / 40

3. Python has a set of built-in methods that you can use on lists/arrays

4 / 40

4. Comments starts with a #

5 / 40

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

6 / 40

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

7 / 40

7.

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

8 / 40

8. Extension of all Python  Programme are .py

9 / 40

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

10 / 40

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

11 / 40

11. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

12 / 40

12.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

13 / 40

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

14 / 40

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

15 / 40

15. During Installation Make sure to select both the checkboxes at the bottom .

16 / 40

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

17 / 40

17. Python relies on indentation?

18 / 40

18.

What will be the output of above Python code?

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

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

19 / 40

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

20 / 40

20.

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

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

21 / 40

21. Python has various versions available

22 / 40

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

23 / 40

23.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

24 / 40

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

25 / 40

25.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

26 / 40

26.

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

27 / 40

27. Who developed Python Programming Language?

28 / 40

28. Strings in python are surrounded by either single quotation marks, or double quotation marks

29 / 40

29. Python is an interpreted programming language

30 / 40

30.

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

a. 2

b. 3

c. 5

d. Multiple times

31 / 40

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

32 / 40

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

33 / 40

33. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

34 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

35 / 40

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

36 / 40

36.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

37 / 40

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

38 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

39 / 40

39. Python can be used on a server to create web applications?

40 / 40

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

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.