[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

2 / 40

2.

How to copy one list to another in python?

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

3 / 40

3. python file can also run on command line

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7.

What will be the output of below Python code?

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

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

8 / 40

8.

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

a. [ ]

b. { }

c. ( )

d. None of the above

9 / 40

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

10 / 40

10. Variable names are case-sensitive

11 / 40

11. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

12 / 40

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

13 / 40

13.

What will be the output of below Python code?

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

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

14 / 40

14.

 Select the correct example of complex datatype in Python

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

15 / 40

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

16 / 40

16.

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

17 / 40

17. You can also have an else without the elif

18 / 40

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

19 / 40

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

20 / 40

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

 

21 / 40

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

22 / 40

22. You can use the append() method to add an element to an array

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

27 / 40

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

28 / 40

28. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

29 / 40

29. Extension of all Python  Programme are .py

30 / 40

30.

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

31 / 40

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

32 / 40

32.

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

33 / 40

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

34 / 40

34.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

39.

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.

40 / 40

40. Most recent major version of Python is Python 3

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.