[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

2 / 40

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

3 / 40

3.

 What is output of: 35 == 35.0

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

4 / 40

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

5 / 40

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

6 / 40

6. The else keyword catches anything which isn’t caught by the preceding conditions.

7 / 40

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

8 / 40

8.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

9 / 40

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

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.

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

12 / 40

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

13 / 40

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

14 / 40

14. With the break statement we can stop the loop before it has looped through all the items

15 / 40

15. Python can connect to database systems.

16 / 40

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

17 / 40

17.

 ____________________ 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

18 / 40

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

19 / 40

19. Comparison operators are not  used to compare two values

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27. Camel Case
Each word, except the first, starts with a capital letter:

28 / 40

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

29 / 40

29. A variable name cannot start with a number

30 / 40

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

31 / 40

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

32 / 40

32. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

33 / 40

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

34 / 40

34.

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

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

35 / 40

35. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

36 / 40

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

37 / 40

37. python has two primitive loop commands:

  • while loops
  • for loops

38 / 40

38. Python is a  high-level programming language.

39 / 40

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

40 / 40

40. Comments can’t be used to prevent execution when testing code.

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.