[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. python has two primitive loop commands:

  • while loops
  • for loops

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9. Bitwise operators are used to compare (binary) numbers

10 / 40

10. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

11 / 40

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

12 / 40

12. Which keyword is used for function?
a) Fun
b) Define
c) Def
d) Function

13 / 40

13. Variable names are case-sensitive

14 / 40

14. Python can be used to handle big data and perform complex mathematics.

15 / 40

15.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

16 / 40

16.

What will be the output of above Python code?

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

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

17 / 40

17.

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

18 / 40

18. Python relies on indentation?

19 / 40

19. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27. A variable name cannot start with a number

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. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

30 / 40

30.

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

31 / 40

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

32 / 40

32. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

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.

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

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

35 / 40

35. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39.

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

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

40 / 40

40. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

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.