[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6.

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

7 / 40

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

8 / 40

8.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

9 / 40

9. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

10 / 40

10.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

11 / 40

11.

What will be the output of above Python code?

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

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

12 / 40

12.

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.

13 / 40

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

14 / 40

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

15 / 40

15.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

16 / 40

16. Variable names are case-sensitive

17 / 40

17. Snake Case
Each word is separated by an underscore character:

18 / 40

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

19 / 40

19. python file can also run on command line

20 / 40

20. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

21 / 40

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

22 / 40

22. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

23 / 40

23. Python can connect to database systems.

24 / 40

24. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

25 / 40

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

26 / 40

26.

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

a. Define

b. DEF

c. def

d. Def

27 / 40

27. Comparison operators are not  used to compare two values

28 / 40

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

29 / 40

29. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

33. Python has various versions available

34 / 40

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

35 / 40

35.

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

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

36 / 40

36. Python is an interpreted programming language

37 / 40

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

38 / 40

38.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

39 / 40

39. You can use the append() method to add an element to an array

40 / 40

40. You can also have an else without the elif

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.