[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. To insert characters that are illegal in a string, use an escape character

3 / 40

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

4 / 40

4.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

5 / 40

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

6 / 40

6. Variable names are case-sensitive

7 / 40

7.

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

8 / 40

8. Is there any comments in  following codes

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

 

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

13 / 40

13.

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.

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

18 / 40

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

19 / 40

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

20 / 40

20.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

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

28 / 40

28. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

29 / 40

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

30 / 40

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

31 / 40

31. The format() method takes the passed arguments

32 / 40

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

33 / 40

33.

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

a. Define

b. DEF

c. def

d. Def

34 / 40

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

35 / 40

35.

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

36 / 40

36.

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

37 / 40

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

38 / 40

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

39 / 40

39. You can use the pop() method to remove an element from the array

40 / 40

40.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

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.