[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which is the correct operator for power(xy)?

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

2 / 40

2. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

3 / 40

3. You can also have an else without the elif

4 / 40

4.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

5 / 40

5. python file can also run on command line

6 / 40

6. You can use the pop() method to remove an element from the array

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

11. python has two primitive loop commands:

  • while loops
  • for loops

12 / 40

12.

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.

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. Strings in python are surrounded by either single quotation marks, or double quotation marks

15 / 40

15. Is there any comments in  following codes

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

 

16 / 40

16. Python can be treated in a procedural way, an object-oriented way or a functional way.

17 / 40

17. Variable names are case-sensitive

18 / 40

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

19 / 40

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

20 / 40

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

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. Arrays are used to store multiple values in one single variable.

23 / 40

23.

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

a. True

b. False

24 / 40

24.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

25 / 40

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

a. 5

b. 3

c. 6

d. 7

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29. Python is an interpreted programming language

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34.

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.

35 / 40

35. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

36 / 40

36.

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

a. 2

b. 3

c. 5

d. Multiple times

37 / 40

37.

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

a. Define

b. DEF

c. def

d. Def

38 / 40

38.

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

39 / 40

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

40 / 40

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

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.