[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="Information"print(str1[2:8])

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

2 / 40

2.

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.

3 / 40

3.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

9 / 40

9. Most recent major version of Python is Python 3

10 / 40

10.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

11 / 40

11. Who developed Python Programming Language?

12 / 40

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

13 / 40

13.

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

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

14 / 40

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

15 / 40

15. You can have if statements inside if statements, this is called nested if statements.

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. A variable name cannot start with a number

18 / 40

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

19 / 40

19. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

20 / 40

20.

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

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

21 / 40

21. python has two primitive loop commands:

  • while loops
  • for loops

22 / 40

22. Variable names are case-sensitive

23 / 40

23. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

24 / 40

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

25 / 40

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

26 / 40

26. Operators are used to perform operations on variables and values

27 / 40

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

28 / 40

28. Is there any comments in  following codes

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

 

29 / 40

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

30 / 40

30. Comments can be used to explain Python code.

31 / 40

31.

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

32 / 40

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

33 / 40

33.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

34 / 40

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

35 / 40

35. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

36 / 40

36.

 ____________________ 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

37 / 40

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

38 / 40

38.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

39 / 40

39. Python is an interpreted programming language

40 / 40

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

a. 5

b. 3

c. 6

d. 7

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.