[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. Python has a set of built-in methods that you can use on lists/arrays

3 / 40

3.

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

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

4 / 40

4. Most recent major version of Python is Python 3

5 / 40

5. Python is an interpreted programming language

6 / 40

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

7 / 40

7.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

8 / 40

8.

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

a. True

b. False

9 / 40

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

10 / 40

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

11 / 40

11.

How to copy one list to another in python?

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

15. Comments can be used to explain Python code.

16 / 40

16. Python can be install on both  Linux and  Windows

17 / 40

17.

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

18 / 40

18. Comparison operators are not  used to compare two values

19 / 40

19. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

20 / 40

20. print() function is often used to output variables.

21 / 40

21.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

22 / 40

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

23 / 40

23.

 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.

24 / 40

24. Python can connect to database systems.

25 / 40

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

26 / 40

26.

What will be the output of above Python code?

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

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

27 / 40

27. You can also have an else without the elif

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31. Extension of all Python  Programme are .py

32 / 40

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

33 / 40

33.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37.

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

38 / 40

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

39 / 40

39. The format() method takes the passed arguments

40 / 40

40. Who developed Python Programming Language?

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.