[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

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 data type of print(type(10))

4 / 40

4. Python is a  high-level programming language.

5 / 40

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

6 / 40

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

7 / 40

7. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

8 / 40

8.

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.

9 / 40

9.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

10 / 40

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

11 / 40

11.

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

12 / 40

12. Python relies on indentation?

13 / 40

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

14 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

15 / 40

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

16 / 40

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

17 / 40

17. Who developed Python Programming Language?

18 / 40

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

19 / 40

19.

 Select the correct example of complex datatype in Python

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

20 / 40

20. You can also have an else without the elif

21 / 40

21.

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

22 / 40

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

23 / 40

23.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

24 / 40

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

25 / 40

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

 

26 / 40

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

27 / 40

27. The format() method takes the passed arguments

28 / 40

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

29 / 40

29.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

30 / 40

30.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

31 / 40

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

32 / 40

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

33 / 40

33. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

34 / 40

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

35 / 40

35. Variable names are case-sensitive

36 / 40

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

37 / 40

37. Python can be used on a server to create web applications?

38 / 40

38.

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

a. 2

b. 3

c. 5

d. Multiple times

39 / 40

39.

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

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

40 / 40

40.

What will be the output of below Python code?

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

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

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.