[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7.

What will be the output of below Python code?

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

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

8 / 40

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

9 / 40

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

10 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

11 / 40

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

12 / 40

12. Is there any comments in  following codes

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

 

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16.

 ____________________ 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

17 / 40

17. A variable name must start with a letter or the underscore character

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

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

a. [ ]

b. { }

c. ( )

d. None of the above

23 / 40

23. + operator is used  to get output of multiple variables

24 / 40

24. Comparison operators are not  used to compare two values

25 / 40

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

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. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

31.

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

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

32 / 40

32.

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

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39. Python is a  high-level programming language.

40 / 40

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

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.