[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What will the below Python code will return?

If str1="save paper,save plants"str1.find("save")

A. It returns the first index position of the first occurance of “save” in the given string str1.
B. It returns the last index position of the last occurance of “save” in the given string str1.
C. It returns the last index position of the first occurance of “save” in the given string str1.
D. It returns the first index position of the first occurance of “save” in the given string str1.

2 / 40

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

3 / 40

3. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

4 / 40

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

5 / 40

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

6 / 40

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

7 / 40

7.

 Select the correct example of complex datatype in Python

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

8 / 40

8.

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13.

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.

14 / 40

14.

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

15 / 40

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

 

16 / 40

16. An array is a special variable, which can hold more than one value at a time

17 / 40

17.

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

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

18 / 40

18. Python allows you to extract the values into variables.

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22. Python is an interpreted programming language

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26. Indentation refers to the spaces at the beginning of a code line.

27 / 40

27.

Which function overloads the >> operator?

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

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32.

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

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

33 / 40

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

34 / 40

34. Comments starts with a #

35 / 40

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

36 / 40

36.

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

a. [ ]

b. { }

c. ( )

d. None of the above

37 / 40

37. Which term describes a loop that continues repeating without a terminating (ending) condition?

a) Infinite Loop

b) Conditional Loop

c) Unlimited Loop

d) Sequence Loop

38 / 40

38.

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

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.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

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.