[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

2 / 40

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

3 / 40

3.

 Select the correct example of complex datatype in Python

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

4 / 40

4. The format() method takes the passed arguments

5 / 40

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

6 / 40

6. Python allows you to extract the values into variables.

7 / 40

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

8 / 40

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

9 / 40

9. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

10 / 40

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

11 / 40

11. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

12 / 40

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

13 / 40

13.

What is the value of the expression 100 / 25?

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

14 / 40

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

15 / 40

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

16 / 40

16. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

17 / 40

17.

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

a. Define

b. DEF

c. def

d. Def

18 / 40

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

19 / 40

19. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

20 / 40

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

21 / 40

21. What will be the output of the following Python code?

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25.

 ____________________ 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

26 / 40

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

27 / 40

27.

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.

28 / 40

28.

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

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

29 / 40

29. A variable name can only contain alpha-numeric characters and
underscores

30 / 40

30.

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

31 / 40

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

32 / 40

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

33 / 40

33.

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.

34 / 40

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

35 / 40

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

36 / 40

36.

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

37 / 40

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

38 / 40

38. Comments starts with a #

39 / 40

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

40 / 40

40.

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

a. 2

b. 3

c. 5

d. Multiple times

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.