[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

2 / 40

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

3 / 40

3. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

4 / 40

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

5 / 40

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

 

6 / 40

6. Is there any comments in  following codes

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

 

7 / 40

7. Variables that are created outside of a function

8 / 40

8.

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

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

9 / 40

9.

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.

10 / 40

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

11 / 40

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

12 / 40

12.

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

a. 2

b. 3

c. 5

d. Multiple times

13 / 40

13.

The function can be called in the program by writing function name followed by ____

a. [ ]

b. { }

c. ( )

d. None of the above

14 / 40

14.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

15 / 40

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

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19. Python has various versions available

20 / 40

20. You can use three double quotes only:

a = “””Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.”””
print(a)

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25.

 What is output of: 35 == 35.0

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

26 / 40

26.

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

27 / 40

27. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

28 / 40

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

29 / 40

29. Arrays are used to store multiple values in one single variable.

30 / 40

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

31 / 40

31. The format() method takes the passed arguments

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 of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

34 / 40

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

35 / 40

35. You can use the append() method to add an element to an array

36 / 40

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

37 / 40

37. Extension of all Python  Programme are .py

38 / 40

38. Comparison operators are not  used to compare two values

39 / 40

39. An array is a special variable, which can hold more than one value at a time

40 / 40

40. Python is an interpreted programming language

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.