[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Variable names are case-sensitive

2 / 40

2. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

3 / 40

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

4 / 40

4.

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

5 / 40

5. Python relies on indentation?

6 / 40

6.

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

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. Operators are used to perform operations on variables and values

9 / 40

9.

 ____________________ 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

10 / 40

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

11 / 40

11. You can also have an else without the elif

12 / 40

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

13 / 40

13. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

14 / 40

14. Comparison operators are not  used to compare two values

15 / 40

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

16 / 40

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

17 / 40

17. print() function is often used to output variables.

18 / 40

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

19 / 40

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

20 / 40

20.

What is the value of the expression 100 / 25?

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

21 / 40

21. Camel Case
Each word, except the first, starts with a capital letter:

22 / 40

22. Comments can be used to make the code more readable.

23 / 40

23. Official site of python is www.python.org

24 / 40

24.

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

25 / 40

25. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

26 / 40

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

27 / 40

27. Who developed Python Programming Language?

28 / 40

28.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

29 / 40

29.

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

a. True

b. False

30 / 40

30.

What will be the output of above Python code?

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

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

31 / 40

31.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

32 / 40

32.

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

33 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

34 / 40

34.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

35 / 40

35.

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

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

36 / 40

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

37 / 40

37.

 What is output of: 35 == 35.0

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

38 / 40

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

39 / 40

39. Pip is  not a powerful package management system for Python software packages

40 / 40

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

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

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.