[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. With the for loop we can execute a set of statements

2 / 40

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

3 / 40

3. Python is a  high-level programming language.

4 / 40

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

5 / 40

5. Snake Case
Each word is separated by an underscore character:

6 / 40

6. You can also have multiple else statements on the same line:

7 / 40

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

8 / 40

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

9 / 40

9.

What will be the output of above Python code?

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

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

10 / 40

10. An array can hold many values under a single name

11 / 40

11. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

12 / 40

12. With the break statement we can stop the loop even if the while condition is true

13 / 40

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

14 / 40

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

15 / 40

15.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

16 / 40

16. Is there any comments in  following codes

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

 

17 / 40

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

18 / 40

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

19 / 40

19.

 Select the correct example of complex datatype in Python

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

20 / 40

20. Comparison operators are not  used to compare two values

21 / 40

21.

Function defined to achieve some task as per the programmer’s requirement is called a ___________

a. user defined function

b. library function

c. built in functions

d. All of the above.

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

26.

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

27 / 40

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

28 / 40

28.

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

a. True

b. False

29 / 40

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

30 / 40

30.

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

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

31 / 40

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

32 / 40

32. An array is a special variable, which can hold more than one value at a time

33 / 40

33.

What is the value of the expression 100 / 25?

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

34 / 40

34. Python can connect to database systems.

35 / 40

35. Who developed Python Programming Language?

36 / 40

36. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

37 / 40

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

38 / 40

38. The len() method to return the length of an array

39 / 40

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

40 / 40

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

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.