[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python can connect to database systems.

2 / 40

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

3 / 40

3. Python has various versions available

4 / 40

4.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

5 / 40

5.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9. Variables that are created outside of a function

10 / 40

10. Strings in python are surrounded by either single quotation marks, or double quotation marks

11 / 40

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

12 / 40

12. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

13 / 40

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

14 / 40

14.

 ____________________ 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

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

18. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

19 / 40

19. python file can also run on command line

20 / 40

20.

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

a. [ ]

b. { }

c. ( )

d. None of the above

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24. Who developed Python Programming Language?

25 / 40

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

26 / 40

26. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

27 / 40

27. You can also have multiple else statements on the same line:

28 / 40

28.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

29 / 40

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

30 / 40

30.

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

31 / 40

31. python has two primitive loop commands:

  • while loops
  • for loops

32 / 40

32.

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

33 / 40

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

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

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

37 / 40

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

38 / 40

38. Python is a  high-level programming language.

39 / 40

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

40 / 40

40.

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

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.