[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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.

2 / 40

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

 

3 / 40

3.

What is the data type of print(type(10))

4 / 40

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

5 / 40

5. The for loop does not require an indexing variable to set beforehand

6 / 40

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

7 / 40

7. You can also have an else without the elif

8 / 40

8.

What do we use to define a block of code in Python language?

  1. Key
  2. Brackets
  3. Indentation
  4. None of these

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. Who developed Python Programming Language?

14 / 40

14.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

20 / 40

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

21 / 40

21. Pascal Case
Each word starts with a capital letter:

22 / 40

22.

Which of the following is not a keyword in Python language?

  1. val
  2. raise
  3. try
  4. with

23 / 40

23.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

24 / 40

24. Most recent major version of Python is Python 3

25 / 40

25. Python has various versions available

26 / 40

26. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

27 / 40

27.

Which function overloads the >> operator?

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

28 / 40

28. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

29 / 40

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

30 / 40

30.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

31 / 40

31. python has two primitive loop commands:

  • while loops
  • for loops

32 / 40

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

33 / 40

33. Python has a set of built-in methods that you can use on lists/arrays

34 / 40

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

35 / 40

35.

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

36 / 40

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

37 / 40

37. Python can be install on both  Linux and  Windows

38 / 40

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

39 / 40

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

40 / 40

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

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.