[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

2 / 40

2. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

3 / 40

3. Operators are used to perform operations on variables and values

4 / 40

4.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

5 / 40

5.

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

6 / 40

6.

How to copy one list to another in python?

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

7 / 40

7. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

8 / 40

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

9 / 40

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

10 / 40

10.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

11 / 40

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

12 / 40

12.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

13 / 40

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

14 / 40

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

15 / 40

15. Extension of all Python  Programme are .py

16 / 40

16.

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.

17 / 40

17. + operator is used  to get output of multiple variables

18 / 40

18.

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

19 / 40

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

20 / 40

20.

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

a. 2

b. 3

c. 5

d. Multiple times

21 / 40

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

22 / 40

22. Python allows you to extract the values into variables.

23 / 40

23. You can also use the remove() method to remove an element from the array

24 / 40

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

25 / 40

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

26 / 40

26. Most recent major version of Python is Python 3

27 / 40

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

a. 5

b. 3

c. 6

d. 7

28 / 40

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

29 / 40

29. Python is a  high-level programming language.

30 / 40

30. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

31 / 40

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

32 / 40

32. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

33 / 40

33. Python has various versions available

34 / 40

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

35 / 40

35. Comments starts with a #

36 / 40

36. During Installation Make sure to select both the checkboxes at the bottom .

37 / 40

37. Snake Case
Each word is separated by an underscore character:

38 / 40

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

39 / 40

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

40 / 40

40. Python will give you an error if you skip the indentation

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.