[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

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

4 / 40

4. Operators are used to perform operations on variables and values

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

8.

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

9 / 40

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

10 / 40

10. Python can be treated in a procedural way, an object-oriented way or a functional way.

11 / 40

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

a. 5

b. 3

c. 6

d. 7

12 / 40

12. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

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. Bitwise operators are used to compare (binary) numbers

15 / 40

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

16 / 40

16. Indentation refers to the spaces at the beginning of a code line.

17 / 40

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

18 / 40

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

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. The format() method takes the passed arguments

22 / 40

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

23 / 40

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

24 / 40

24.

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

a. 2

b. 3

c. 5

d. Multiple times

25 / 40

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

26 / 40

26.

What will be the output of below Python code?

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

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

27 / 40

27. Extension of all Python  Programme are .py

28 / 40

28.

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

29 / 40

29. Variable names are case-sensitive

30 / 40

30. Who developed Python Programming Language?

31 / 40

31. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

32 / 40

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

33 / 40

33. A variable name cannot start with a number

34 / 40

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

35 / 40

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

36 / 40

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

 

37 / 40

37.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

38 / 40

38.

What will be the output of below Python code?

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

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

39 / 40

39.

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

a. True

b. False

40 / 40

40.

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

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.