[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Variable names are case-sensitive

2 / 40

2. Python can connect to database systems.

3 / 40

3.

Which is the correct operator for power(xy)?

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

4 / 40

4. With the break statement we can stop the loop even if the while condition is true

5 / 40

5.

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

6 / 40

6. Python can be install on both  Linux and  Windows

7 / 40

7. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

8 / 40

8.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

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

14 / 40

14. Python relies on indentation?

15 / 40

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

16 / 40

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

17 / 40

17. Python is a  high-level programming language.

18 / 40

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

19 / 40

19.

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

a. Define

b. DEF

c. def

d. Def

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23. Python has a set of built-in methods that you can use on lists/arrays

24 / 40

24. During Installation Make sure to select both the checkboxes at the bottom .

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29.

What will be the output of above Python code?

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

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

30 / 40

30.

 Select the correct example of complex datatype in Python

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

31 / 40

31.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

32 / 40

32. Extension of all Python  Programme are .py

33 / 40

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

34 / 40

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

35 / 40

35. Comments starts with a #

36 / 40

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

37 / 40

37. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

38 / 40

38.

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.

39 / 40

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

40 / 40

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

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.