[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

 What is output of: 35 == 35.0

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

2 / 40

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

3 / 40

3. A variable name cannot start with a number

4 / 40

4.

What will be the output of below Python code?

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

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

5 / 40

5. python has two primitive loop commands:

  • while loops
  • for loops

6 / 40

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

7 / 40

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

a. 5

b. 3

c. 6

d. 7

8 / 40

8.

 Select the correct example of complex datatype in Python

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

9 / 40

9. Python can be install on both  Linux and  Windows

10 / 40

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

11 / 40

11. The else keyword catches anything which isn’t caught by the preceding conditions.

12 / 40

12. Python has various versions available

13 / 40

13.

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

14 / 40

14. Python is a  high-level programming language.

15 / 40

15.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

16 / 40

16.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20. Comments starts with a #

21 / 40

21. You can also have an else without the elif

22 / 40

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

23 / 40

23.

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.

24 / 40

24.

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.

25 / 40

25. Python relies on indentation?

26 / 40

26.

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

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30. Comparison operators are not  used to compare two values

31 / 40

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

32 / 40

32.

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

33 / 40

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

34 / 40

34.

Which is the correct operator for power(xy)?

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

35 / 40

35.

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

36 / 40

36.

 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.

37 / 40

37.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

38 / 40

38.

In a program, a function can be called ____________ times.

a. 2

b. 3

c. 5

d. Multiple times

39 / 40

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

40 / 40

40. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) 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.