[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

a. [ ]

b. { }

c. ( )

d. None of the above

2 / 40

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

3 / 40

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

4 / 40

4.

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

5 / 40

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

6 / 40

6. Camel Case
Each word, except the first, starts with a capital letter:

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

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

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.

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

13 / 40

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

14 / 40

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

15 / 40

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

16 / 40

16. Pascal Case
Each word starts with a capital letter:

17 / 40

17.

What will be the output of below Python code?

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

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

18 / 40

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

19 / 40

19.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

20 / 40

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

21 / 40

21.

 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.

22 / 40

22.

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.

23 / 40

23. Is there any comments in  following codes

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

 

24 / 40

24.

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.

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

29 / 40

29. Python has various versions available

30 / 40

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

31 / 40

31. Python can be install on both  Linux and  Windows

32 / 40

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

33 / 40

33.

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

34 / 40

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

35 / 40

35.

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

a. Define

b. DEF

c. def

d. Def

36 / 40

36. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

37 / 40

37. Who developed Python Programming Language?

38 / 40

38.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

39 / 40

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

40 / 40

40.

 Select the correct example of complex datatype in Python

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

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.