[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Arrays are used to store multiple values in one single variable.

2 / 40

2.

 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.

3 / 40

3.

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

4 / 40

4.

 ____________________ 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

5 / 40

5. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

6 / 40

6.

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

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. The format() method takes unlimited number of arguments

9 / 40

9. Comments can be used to make the code more readable.

10 / 40

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

11 / 40

11. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

12 / 40

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

13 / 40

13. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

14 / 40

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

15 / 40

15. Is there any comments in  following codes

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

 

16 / 40

16.

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

a. True

b. False

17 / 40

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

18 / 40

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

19 / 40

19.

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

20 / 40

20.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24.

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

a. [ ]

b. { }

c. ( )

d. None of the above

25 / 40

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

26 / 40

26.

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

a. 2

b. 3

c. 5

d. Multiple times

27 / 40

27. Variables that are created outside of a function

28 / 40

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

29 / 40

29.

 Select the correct example of complex datatype in Python

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

30 / 40

30.

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.

31 / 40

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

32 / 40

32. Comments can’t be used to prevent execution when testing code.

33 / 40

33. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

34 / 40

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

35 / 40

35. The format() method takes the passed arguments

36 / 40

36. Extension of all Python  Programme are .py

37 / 40

37.

In Python, a variable may be assigned a value of one type, and then later assigned a value of a different type:

  1. False
  2. True

38 / 40

38.

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

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

39 / 40

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

40 / 40

40.

What is the value of the expression 100 / 25?

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

Exit



Hurry Up!

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