[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

What is the value of the expression 100 / 25?

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

2 / 40

2.

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.

3 / 40

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

4 / 40

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

5 / 40

5. Python can be used to handle big data and perform complex mathematics.

6 / 40

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

7 / 40

7. Variables that are created outside of a function

8 / 40

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

9 / 40

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

10 / 40

10.

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

a. Define

b. DEF

c. def

d. Def

11 / 40

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

12 / 40

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

13 / 40

13.

 Select the correct example of complex datatype in Python

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

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. Python has various versions available

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

23 / 40

23.

 What is output of: 35 == 35.0

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

24 / 40

24.

What will be the output of below Python code?

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

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

25 / 40

25. Comparison operators are not  used to compare two values

26 / 40

26.

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

27 / 40

27. Comments starts with a #

28 / 40

28. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

29 / 40

29. Python has a set of built-in methods that you can use on lists/arrays

30 / 40

30.

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

31 / 40

31.

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

a. 2

b. 3

c. 5

d. Multiple times

32 / 40

32.

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

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. Python is a  high-level programming language.

37 / 40

37.

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

a. True

b. False

38 / 40

38. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

39 / 40

39. Python is an interpreted programming language

40 / 40

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

a. 5

b. 3

c. 6

d. 7

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.