[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

 ____________________ 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

2 / 40

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

3 / 40

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

4 / 40

4. Who developed Python Programming Language?

5 / 40

5.

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

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

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10. The else keyword catches anything which isn’t caught by the preceding conditions.

11 / 40

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

12 / 40

12. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

13 / 40

13. You can have if statements inside if statements, this is called nested if statements.

14 / 40

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

15 / 40

15.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

16 / 40

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

17 / 40

17. Python can be install on both  Linux and  Windows

18 / 40

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

19 / 40

19. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

20 / 40

20.

What is the value of the expression 100 / 25?

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

21 / 40

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

22 / 40

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

23 / 40

23. Python relies on indentation?

24 / 40

24. The length of an array is always one more than the highest array index.

25 / 40

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

26 / 40

26. Python is an interpreted programming language

27 / 40

27.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

28 / 40

28. Variables that are created outside of a function

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32.

What will be the output of below Python code?

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

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

33 / 40

33. Most recent major version of Python is Python 3

34 / 40

34.

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

35 / 40

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

36 / 40

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

37 / 40

37.

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

38 / 40

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

39 / 40

39.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

40 / 40

40. The format() method takes unlimited number of arguments

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.