[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 statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

2 / 40

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

3 / 40

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

4 / 40

4.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9.

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.

10 / 40

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

11 / 40

11. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

12 / 40

12.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

13 / 40

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

14 / 40

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

15 / 40

15. Python relies on indentation?

16 / 40

16. The length of an array is always one more than the highest array index.

17 / 40

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

18 / 40

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

19 / 40

19.

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

20 / 40

20.

What is the value of the expression 100 / 25?

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

21 / 40

21.

Which function overloads the >> operator?

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

26 / 40

26.

 Select the correct example of complex datatype in Python

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

27 / 40

27. Python is an interpreted programming language

28 / 40

28.

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

a. 2

b. 3

c. 5

d. Multiple times

29 / 40

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

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. python file can also run on command line

32 / 40

32. Who developed Python Programming Language?

33 / 40

33.

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

a. Define

b. DEF

c. def

d. Def

34 / 40

34. Comments can be used to explain Python code.

35 / 40

35. python has two primitive loop commands:

  • while loops
  • for loops

36 / 40

36.

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

37 / 40

37.

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

38 / 40

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

39 / 40

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

40 / 40

40.

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

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.