[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

 

2 / 40

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

3 / 40

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

4 / 40

4. Python can connect to database systems.

5 / 40

5.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

6 / 40

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

7 / 40

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

8 / 40

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

9 / 40

9.

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

a. Define

b. DEF

c. def

d. Def

10 / 40

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

11 / 40

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

12 / 40

12. Extension of all Python  Programme are .py

13 / 40

13.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

14 / 40

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

15 / 40

15.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19. Is there any comments in  following codes

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

 

20 / 40

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

21 / 40

21. What does the following code print?

x = -10if x < 0:    print("The negative number ",  x, " is not valid here.")print("This is always printed")
a.This is always printedb.The negative number -10 is not valid hereThis is always printedc.The negative number -10 is not valid here

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

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

26 / 40

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

27 / 40

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

28 / 40

28.

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

29 / 40

29. Python has various versions available

30 / 40

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

31 / 40

31.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

32 / 40

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

33 / 40

33. Comparison operators are not  used to compare two values

34 / 40

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

35 / 40

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

36 / 40

36.

What will be the output of below Python code?

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

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

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

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.