[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

4. Comparison operators are not  used to compare two values

5 / 40

5.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

6 / 40

6. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

7 / 40

7. The format() method takes the passed arguments

8 / 40

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

9 / 40

9.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

10 / 40

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

11 / 40

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

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

14 / 40

14.

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

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

15 / 40

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

16 / 40

16.

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

a. [ ]

b. { }

c. ( )

d. None of the above

17 / 40

17. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

18 / 40

18.

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

a. Define

b. DEF

c. def

d. Def

19 / 40

19.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

20 / 40

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

21 / 40

21. The list’s remove() method only removes the first occurrence of the specified value.

22 / 40

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

23 / 40

23.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

24 / 40

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

25 / 40

25.

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

a. True

b. False

26 / 40

26. Python relies on indentation?

27 / 40

27. The for loop does not require an indexing variable to set beforehand

28 / 40

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

29 / 40

29. Python can connect to database systems.

30 / 40

30.

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

31 / 40

31. python has two primitive loop commands:

  • while loops
  • for loops

32 / 40

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

33 / 40

33. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

34 / 40

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

35 / 40

35. Python can be install on both  Linux and  Windows

36 / 40

36. Comments can be used to explain Python code.

37 / 40

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

38 / 40

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

39 / 40

39. python file can also run on command line

40 / 40

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

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.