[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Python can be install on both  Linux and  Windows

2 / 40

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

3 / 40

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

4 / 40

4.

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

a. Define

b. DEF

c. def

d. Def

5 / 40

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

6 / 40

6. Python has a set of built-in methods that you can use on lists/arrays

7 / 40

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

8 / 40

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

9 / 40

9. Python has various versions available

10 / 40

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

 

11 / 40

11.

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

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17.

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

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

18 / 40

18. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

19 / 40

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

20 / 40

20. A variable name can only contain alpha-numeric characters and
underscores

21 / 40

21. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

22 / 40

22. Python is a  high-level programming language.

23 / 40

23. Most recent major version of Python is Python 3

24 / 40

24.

Which function overloads the >> operator?

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

25 / 40

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

26 / 40

26.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

27 / 40

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

28 / 40

28.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

29 / 40

29.

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

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

30 / 40

30.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

31 / 40

31.

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

32 / 40

32.

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.

33 / 40

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

34 / 40

34.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

35 / 40

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

36 / 40

36.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

37 / 40

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

38 / 40

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

39 / 40

39. Variables that are created outside of a function

40 / 40

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

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.