[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6.

 Which of the following statement is False?

  1. Variable names can be arbitrarily long.
  2. They can contain both letters and numbers.
  3. Variable name can begin with underscore.
  4. Variable name can begin with number.

7 / 40

7. Is there any comments in  following codes

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

 

8 / 40

8.

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

a. True

b. False

9 / 40

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

10 / 40

10. Comments can be used to explain Python code.

11 / 40

11.

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

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

12 / 40

12. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

13 / 40

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

14 / 40

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

15 / 40

15. Python has various versions available

16 / 40

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

17 / 40

17.

Which function overloads the >> operator?

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

18 / 40

18. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

19 / 40

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

20 / 40

20. The format() method takes the passed arguments

21 / 40

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

22 / 40

22.

Which of the following is False?

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

23 / 40

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

24 / 40

24. Python can connect to database systems.

25 / 40

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

26 / 40

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

27 / 40

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

 

28 / 40

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

29 / 40

29. Python is a  high-level programming language.

30 / 40

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

31 / 40

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

32 / 40

32. Variables that are created outside of a function

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. Python can be used to handle big data and perform complex mathematics.

37 / 40

37.

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

38 / 40

38. Comparison operators are not  used to compare two values

39 / 40

39.

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.

40 / 40

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

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.