[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Variable names are case-sensitive

2 / 40

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

3 / 40

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

4 / 40

4. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

5 / 40

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

6 / 40

6. Comments can be used to explain Python code.

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

11 / 40

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

12 / 40

12. Python relies on indentation?

13 / 40

13. python file can also run on command line

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

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

22 / 40

22.

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

23 / 40

23.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

27.

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

a. [ ]

b. { }

c. ( )

d. None of the above

28 / 40

28.

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

29 / 40

29.

What will be the output of below Python code?

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

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

30 / 40

30.

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

31 / 40

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

32 / 40

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

33 / 40

33.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

34 / 40

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

35 / 40

35. Official site of python is www.python.org

36 / 40

36.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

37 / 40

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

38 / 40

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

39 / 40

39.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

40 / 40

40. Comparison operators are not  used to compare two values

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.