[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. With the break statement we can stop the loop before it has looped through all the items

4 / 40

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

5 / 40

5.

 Select the correct example of complex datatype in Python

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

10 / 40

10. With the for loop we can execute a set of statements

11 / 40

11. Is there any comments in  following codes

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

 

12 / 40

12.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

13 / 40

13. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

14 / 40

14. Python has various versions available

15 / 40

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

16 / 40

16.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

17 / 40

17. Comments can be used to explain Python code.

18 / 40

18. Who developed Python Programming Language?

19 / 40

19.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

20 / 40

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

21 / 40

21.

What will be the output of below Python code?

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

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29.

What is the data type of print(type(10))

30 / 40

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

31 / 40

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

32 / 40

32. The format() method takes unlimited number of arguments

33 / 40

33.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

34 / 40

34.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

35 / 40

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

36 / 40

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

37 / 40

37. python has two primitive loop commands:

  • while loops
  • for loops

38 / 40

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

39 / 40

39.

What is the data type of print(type(0xFF))

40 / 40

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

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.