[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

 ____________________ 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

3 / 40

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

4 / 40

4. python file can also run on command line

5 / 40

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

6 / 40

6. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

7 / 40

7.

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

a. Define

b. DEF

c. def

d. Def

8 / 40

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

9 / 40

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

10 / 40

10. The format() method takes the passed arguments

11 / 40

11. Comments starts with a #

12 / 40

12. Python relies on indentation?

13 / 40

13.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

14 / 40

14. Comments can be used to explain Python code.

15 / 40

15.

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

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

16 / 40

16. Variables that are created outside of a function

17 / 40

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

18 / 40

18. With the for loop we can execute a set of statements

19 / 40

19.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

20 / 40

20. Python can be install on both  Linux and  Windows

21 / 40

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

22 / 40

22.

What will be the output of above Python code?

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

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

23 / 40

23.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

24 / 40

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

25 / 40

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

26 / 40

26. A variable name cannot start with a number

27 / 40

27. Variable names are case-sensitive

28 / 40

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

29 / 40

29.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

30 / 40

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

31 / 40

31. Python is an interpreted programming language

32 / 40

32.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

33 / 40

33. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37.

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

38 / 40

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

39 / 40

39.

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.

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.