[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. Python has various versions available

4 / 40

4.

Which function overloads the >> operator?

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

5 / 40

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

6 / 40

6.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

7 / 40

7. Python can be used on a server to create web applications?

8 / 40

8. Which of the following is the correct extension of the Python file?

9 / 40

9. Python is a  high-level programming language.

10 / 40

10. Comparison operators are not  used to compare two values

11 / 40

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

12 / 40

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

13 / 40

13. python file can also run on command line

14 / 40

14. Comments can be used to explain Python code.

15 / 40

15.

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

16 / 40

16. Python can be install on both  Linux and  Windows

17 / 40

17.

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.

18 / 40

18.

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

19 / 40

19. Is there any comments in  following codes

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

 

20 / 40

20. Extension of all Python  Programme are .py

21 / 40

21. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

22 / 40

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

23 / 40

23.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

24 / 40

24.

What is the value of the expression 100 / 25?

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

25 / 40

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

26 / 40

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

27 / 40

27. An array is a special variable, which can hold more than one value at a time

28 / 40

28.

How to copy one list to another in python?

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

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

33 / 40

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

34 / 40

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

35 / 40

35.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

36 / 40

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

37 / 40

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

38 / 40

38.

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

39 / 40

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

40 / 40

40. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

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.