[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

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

2 / 40

2. Comments starts with a #

3 / 40

3. You can return a range of characters by using the slice syntax

4 / 40

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

5 / 40

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

6 / 40

6. Pip is  not a powerful package management system for Python software packages

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10. You can also have multiple else statements on the same line:

11 / 40

11.

What is the data type of print(type(10))

12 / 40

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

13 / 40

13.

What will be the output of below Python code?

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

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

14 / 40

14. Comparison operators are not  used to compare two values

15 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

16 / 40

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

a. 5

b. 3

c. 6

d. 7

17 / 40

17.

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

18 / 40

18.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

19 / 40

19. Python can connect to database systems.

20 / 40

20. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

21 / 40

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

22 / 40

22.

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

23 / 40

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

24 / 40

24.

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

a. [ ]

b. { }

c. ( )

d. None of the above

25 / 40

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

26 / 40

26.

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

27 / 40

27. Python can be install on both  Linux and  Windows

28 / 40

28. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

29 / 40

29. Most recent major version of Python is Python 3

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34. Comments can be used to explain Python code.

35 / 40

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

36 / 40

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

37 / 40

37.

 Select the correct example of complex datatype in Python

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

38 / 40

38.

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

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

39 / 40

39. The format() method takes the passed arguments

40 / 40

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

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.