[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. Comments starts with a #

4 / 40

4. With the break statement we can stop the loop even if the while condition is true

5 / 40

5.

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

6 / 40

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

7 / 40

7. Python has various versions available

8 / 40

8. Most recent major version of Python is Python 3

9 / 40

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

10 / 40

10. You can also have an else without the elif

11 / 40

11.

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.

12 / 40

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

13 / 40

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

14 / 40

14. python has two primitive loop commands:

  • while loops
  • for loops

15 / 40

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

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. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

18 / 40

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

19 / 40

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

20 / 40

20.

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

21 / 40

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

22 / 40

22. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

23 / 40

23. To insert characters that are illegal in a string, use an escape character

24 / 40

24. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

25 / 40

25. Python is a  high-level programming language.

26 / 40

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

27 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

28 / 40

28. Python is an interpreted programming language

29 / 40

29.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

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

34 / 40

34.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

35 / 40

35.

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

36 / 40

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

37 / 40

37. Comments can be used to explain Python code.

38 / 40

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

39 / 40

39. Extension of all Python  Programme are .py

40 / 40

40.

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

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.