[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

2 / 40

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

3 / 40

3.

What will be the output of above Python code?

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

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

4 / 40

4.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

5 / 40

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

6 / 40

6. Variable names are case-sensitive

7 / 40

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

8 / 40

8. With the break statement we can stop the loop before it has looped through all the items

9 / 40

9. Python relies on indentation?

10 / 40

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

11 / 40

11.

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

12 / 40

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

13 / 40

13. python file can also run on command line

14 / 40

14.

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

a. [ ]

b. { }

c. ( )

d. None of the above

15 / 40

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

16 / 40

16. Most recent major version of Python is Python 3

17 / 40

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

18 / 40

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

a. 5

b. 3

c. 6

d. 7

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.

 ____________________ 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

21 / 40

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

22 / 40

22.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

23 / 40

23.

What will be the output of below Python code?

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

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

24 / 40

24.

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

25 / 40

25. Who developed Python Programming Language?

26 / 40

26.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

27 / 40

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

28 / 40

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

29 / 40

29.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

30 / 40

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

31 / 40

31. Comments starts with a #

32 / 40

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

33 / 40

33.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

34 / 40

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

35 / 40

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

36 / 40

36.

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

37 / 40

37.

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

38 / 40

38. Python can be install on both  Linux and  Windows

39 / 40

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

40 / 40

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

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.