[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. The list’s remove() method only removes the first occurrence of the specified value.

2 / 40

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

3 / 40

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

4 / 40

4. Who developed Python Programming Language?

5 / 40

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

6 / 40

6.

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.

7 / 40

7.

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

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

8 / 40

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

9 / 40

9. We can combine strings and numbers by using the format() method

10 / 40

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

11 / 40

11.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

12 / 40

12.

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

13 / 40

13. The format() method takes the passed arguments

14 / 40

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

15 / 40

15. Variable names are case-sensitive

16 / 40

16. A variable name must start with a letter or the underscore character

17 / 40

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

18 / 40

18. Extension of all Python  Programme are .py

19 / 40

19. A variable name cannot start with a number

20 / 40

20.

How to copy one list to another in python?

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

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. Comments can’t be used to prevent execution when testing code.

23 / 40

23.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

24 / 40

24. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

25 / 40

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

26 / 40

26. Snake Case
Each word is separated by an underscore character:

27 / 40

27.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

28 / 40

28.

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

29 / 40

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

30 / 40

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

31 / 40

31. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

32 / 40

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

33 / 40

33.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

34 / 40

34.

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

a. 2

b. 3

c. 5

d. Multiple times

35 / 40

35.

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

36 / 40

36.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

37 / 40

37. Strings in python are surrounded by either single quotation marks, or double quotation marks

38 / 40

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

39 / 40

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

40 / 40

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

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.