[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 is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

2 / 40

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

3 / 40

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

4 / 40

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

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

a) Hi
b) Know Program

c)
Hi
Hello

d)
Know Program
Hello

5 / 40

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

6 / 40

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

7 / 40

7. Python has various versions available

8 / 40

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

 

9 / 40

9.

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.

10 / 40

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

11 / 40

11.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

12 / 40

12. Most recent major version of Python is Python 3

13 / 40

13.

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

14 / 40

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

15 / 40

15.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

16 / 40

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

17 / 40

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

18 / 40

18.

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

 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.

23 / 40

23. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

24 / 40

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

25 / 40

25.

 What is output of: 35 == 35.0

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

30 / 40

30. Comments can be used to explain Python code.

31 / 40

31. We can combine strings and numbers by using the format() method

32 / 40

32. Is there any comments in  following codes

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

 

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36.

What will be the output of below Python code?

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

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

37 / 40

37. What will be the output of the following Python code?

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

38 / 40

38.

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

39 / 40

39. Variables that are created outside of a function

40 / 40

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

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.