[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

2 / 40

2. Extension of all Python  Programme are .py

3 / 40

3. python has two primitive loop commands:

  • while loops
  • for loops

4 / 40

4. Python has various versions available

5 / 40

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

6 / 40

6. 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()

 

7 / 40

7. Python can be treated in a procedural way, an object-oriented way or a functional way.

8 / 40

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

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

12.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

13 / 40

13.

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

a. [ ]

b. { }

c. ( )

d. None of the above

14 / 40

14.

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.

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.

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

22 / 40

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

23 / 40

23.

What will be the output of below Python code?

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

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

24 / 40

24.

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

25 / 40

25.

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.

26 / 40

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

27 / 40

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

28 / 40

28. Comments starts with a #

29 / 40

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

30 / 40

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

31 / 40

31.

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

32 / 40

32. To insert characters that are illegal in a string, use an escape character

33 / 40

33. Is there any comments in  following codes

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

 

34 / 40

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

35 / 40

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

36 / 40

36. Variables that are created outside of a function

37 / 40

37. You have to use the same number of spaces in the same block of code, otherwise Python will give you an error

38 / 40

38. You can use the pop() method to remove an element from the array

39 / 40

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

40 / 40

40.

Which is the correct operator for power(xy)?

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

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.