[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4.

 What is output of: 35 == 35.0

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

5 / 40

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

6 / 40

6.

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

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

7 / 40

7. Variable names are case-sensitive

8 / 40

8. Bitwise operators are used to compare (binary) numbers

9 / 40

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

10 / 40

10. Is there any comments in  following codes

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

 

11 / 40

11. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

12 / 40

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

13 / 40

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

14 / 40

14.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

26 / 40

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

27 / 40

27.

Which function overloads the >> operator?

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

28 / 40

28. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

29 / 40

29. Pascal Case
Each word starts with a capital letter:

30 / 40

30. Comments can be used to explain Python code.

31 / 40

31. Python can be used to handle big data and perform complex mathematics.

32 / 40

32.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

33 / 40

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

34 / 40

34.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

35 / 40

35.

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

36 / 40

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

37 / 40

37.

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

38 / 40

38.

What is the value of the expression 100 / 25?

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

39 / 40

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

40 / 40

40. Comparison operators are not  used to compare two values

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.