[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

2 / 40

2.

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

3 / 40

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

4 / 40

4. A variable name cannot start with a number

5 / 40

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

6 / 40

6. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

7 / 40

7.

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

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

8 / 40

8.

 ____________________ 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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. Comparison operators are not  used to compare two values

14 / 40

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

15 / 40

15.

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

20 / 40

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

21 / 40

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

22 / 40

22. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

23 / 40

23.

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

24 / 40

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

25 / 40

25.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

26 / 40

26.

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.

27 / 40

27. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

28 / 40

28. You can return a range of characters by using the slice syntax

29 / 40

29.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

30 / 40

30. Python can be install on both  Linux and  Windows

31 / 40

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

32 / 40

32.

What is the value of the expression 100 / 25?

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

33 / 40

33. The list’s remove() method only removes the first occurrence of the specified value.

34 / 40

34. Is there any comments in  following codes

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

 

35 / 40

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

36 / 40

36.

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

37 / 40

37.

What will be the output of above Python code?

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

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

38 / 40

38.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

39 / 40

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

40 / 40

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

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.