[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 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

2 / 40

2. Python can connect to database systems.

3 / 40

3. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

4 / 40

4. A variable name can only contain alpha-numeric characters and
underscores

5 / 40

5. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

6 / 40

6. Most recent major version of Python is Python 3

7 / 40

7.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

8 / 40

8.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

9 / 40

9. A variable name must start with a letter or the underscore character

10 / 40

10. Comments can be used to explain Python code.

11 / 40

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

12 / 40

12. The else keyword catches anything which isn’t caught by the preceding conditions.

13 / 40

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

14 / 40

14.

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

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

15 / 40

15. An array can hold many values under a single name

16 / 40

16. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

17 / 40

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

a. 5

b. 3

c. 6

d. 7

18 / 40

18. With the break statement we can stop the loop before it has looped through all the items

19 / 40

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

20 / 40

20. Comments starts with a #

21 / 40

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

22 / 40

22.

 ____________________ 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

23 / 40

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

24 / 40

24. Arrays are used to store multiple values in one single variable.

25 / 40

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

26 / 40

26.

What will be the output of above Python code?

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

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

27 / 40

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

28 / 40

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

29 / 40

29. You can also have an else without the elif

30 / 40

30.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

31 / 40

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

32 / 40

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

33 / 40

33.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

34 / 40

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

35 / 40

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

36 / 40

36. Python is an interpreted programming language

37 / 40

37.

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

a. [ ]

b. { }

c. ( )

d. None of the above

38 / 40

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

39 / 40

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

40 / 40

40. Which of the following is the correct extension of the Python file?

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.