[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

2 / 40

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

3 / 40

3. Python is an interpreted programming language

4 / 40

4.

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)tupl[0][1]=1print(tupl)A. ([2,3],"abc",0,9)B. ([1,3],"abc",0,9)C. ([2,1],"abc",0,9)D. Error

5 / 40

5. A variable name cannot start with a number

6 / 40

6. Variable names are case-sensitive

7 / 40

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

8 / 40

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

9 / 40

9. The format() method takes the passed arguments

10 / 40

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

11 / 40

11. Python is a  high-level programming language.

12 / 40

12. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

13 / 40

13. python file can also run on command line

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17.

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.

18 / 40

18.

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

19 / 40

19. Python can connect to database systems.

20 / 40

20.

 Select the correct example of complex datatype in Python

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

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25. You can also have an else without the elif

26 / 40

26.

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

27 / 40

27.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

28 / 40

28.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

29 / 40

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

30 / 40

30. Operators are used to perform operations on variables and values

31 / 40

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

 

32 / 40

32. Is there any comments in  following codes

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

 

33 / 40

33.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

34 / 40

34.

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.

35 / 40

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

36 / 40

36. Variables that are created outside of a function

37 / 40

37.

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

38 / 40

38. Pip is  not a powerful package management system for Python software packages

39 / 40

39.

Which function overloads the >> operator?

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

40 / 40

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

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.