[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Who developed Python Programming Language?

2 / 40

2.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

3 / 40

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

4 / 40

4. Python relies on indentation?

5 / 40

5.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

6 / 40

6.

What is the data type of print(type(0xFF))

7 / 40

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

8 / 40

8.

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

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

9 / 40

9. Arrays are used to store multiple values in one single variable.

10 / 40

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

11 / 40

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

12 / 40

12. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

13 / 40

13.

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

a. [ ]

b. { }

c. ( )

d. None of the above

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

18 / 40

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

19 / 40

19.

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

a. 2

b. 3

c. 5

d. Multiple times

20 / 40

20. You can also have an else without the elif

21 / 40

21.

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

a. Define

b. DEF

c. def

d. Def

22 / 40

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

23 / 40

23. The format() method takes the passed arguments

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29. python file can also run on command line

30 / 40

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

31 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

32 / 40

32.

What will be the output of above Python code?

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

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

33 / 40

33. Extension of all Python  Programme are .py

34 / 40

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

35 / 40

35.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

36 / 40

36. Arithmetic operators are used with numeric values to perform common mathematical operations

37 / 40

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

38 / 40

38. We can combine strings and numbers by using the format() method

39 / 40

39. Comparison operators are not  used to compare two values

40 / 40

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

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.