[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 creates a tuple?

A. tuple1=(“a”,”b”)
B. tuple1[2]=(“a”,”b”)
C. tuple1=(5)*2
D. None of the above

2 / 40

2. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

3 / 40

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

4 / 40

4. + operator is used  to get output of multiple variables

5 / 40

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

6 / 40

6.

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

7 / 40

7. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

8 / 40

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

9 / 40

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

10 / 40

10.

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

11 / 40

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

12 / 40

12.

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.

13 / 40

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

14 / 40

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

15 / 40

15.

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

a. True

b. False

16 / 40

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

17 / 40

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

18 / 40

18.

 Select the correct example of complex datatype in Python

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

19 / 40

19.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

20 / 40

20. Python is a  high-level programming language.

21 / 40

21. Comparison operators are not  used to compare two values

22 / 40

22. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

23 / 40

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

24 / 40

24.

What is the data type of print(type(10))

25 / 40

25. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

26 / 40

26. Who developed Python Programming Language?

27 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

28 / 40

28.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

29 / 40

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

30 / 40

30.

What will be the output of below Python code?

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

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

31 / 40

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

32 / 40

32.

 ____________________ 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

33 / 40

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

34 / 40

34. You can also have an else without the elif

35 / 40

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

36 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

37 / 40

37. Comments can be used to explain Python code.

38 / 40

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

39 / 40

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

40 / 40

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

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.