[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7. Most recent major version of Python is Python 3

8 / 40

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

9 / 40

9.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

10 / 40

10. The for loop does not require an indexing variable to set beforehand

11 / 40

11.

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

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

12 / 40

12. Variables that are created outside of a function

13 / 40

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

14 / 40

14. You can also have an else without the elif

15 / 40

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

16 / 40

16. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

17 / 40

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

18 / 40

18. Variable names are case-sensitive

19 / 40

19.

Which of the following creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

20 / 40

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

21 / 40

21.

What will be the output of above Python code?

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

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

22 / 40

22.

 What is output of: 35 == 35.0

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

23 / 40

23. Python relies on indentation?

24 / 40

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

25 / 40

25. Python  was created by Guido van Rossum, and released in 1999.

26 / 40

26. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

27 / 40

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

28 / 40

28.

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

a. True

b. False

29 / 40

29. Comparison operators are not  used to compare two values

30 / 40

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

31 / 40

31. Is there any comments in  following codes

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

 

32 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

33 / 40

33. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

34 / 40

34.

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

a. [ ]

b. { }

c. ( )

d. None of the above

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

40. You can also have multiple else statements on the same line:

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.