[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

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. Who developed Python Programming Language?

6 / 40

6.

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

7 / 40

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

8 / 40

8. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

9 / 40

9.

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

10 / 40

10. Python has various versions available

11 / 40

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

12 / 40

12. What will be the output of the following Python code?

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

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

13 / 40

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

14 / 40

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

15 / 40

15.

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

16 / 40

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

17 / 40

17. Which of the following is the correct extension of the Python file?

18 / 40

18.

What will be the output of below Python code?

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

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

19 / 40

19.

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

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

20 / 40

20. The format() method takes the passed arguments

21 / 40

21. python file can also run on command line

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25.

What will be the output of above Python code?

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

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

26 / 40

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

27 / 40

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

28 / 40

28. Pascal Case
Each word starts with a capital letter:

29 / 40

29. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

30 / 40

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

31 / 40

31. With the break statement we can stop the loop before it has looped through all the items

32 / 40

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

33 / 40

33. Python is an interpreted programming language

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37. Which of the following character is used to give single-line comments in Python?
a) //
b) #
c) !
d) /*

38 / 40

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

a. 5

b. 3

c. 6

d. 7

39 / 40

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

40 / 40

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

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.