[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

3 / 40

3.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

4 / 40

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

5 / 40

5.

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

a. 2

b. 3

c. 5

d. Multiple times

6 / 40

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

7 / 40

7. Python  was created by Guido van Rossum, and released in 1999.

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.

What will be the output of below Python code?

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

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

10 / 40

10.

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

11 / 40

11.

What is the value of the expression 100 / 25?

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

12 / 40

12. Who developed Python Programming Language?

13 / 40

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

14 / 40

14.

 What is output of: 35 == 35.0

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

15 / 40

15. The format() method takes the passed arguments

16 / 40

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

17 / 40

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

18 / 40

18.

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.

19 / 40

19.

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.

20 / 40

20.

Which function overloads the >> operator?

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

21 / 40

21.

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

22 / 40

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

23 / 40

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

24 / 40

24.

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.

25 / 40

25.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

26 / 40

26.

 Select the correct example of complex datatype in Python

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

27 / 40

27. Variables that are created outside of a function

28 / 40

28.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

29 / 40

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

30 / 40

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

31 / 40

31. Bitwise operators are used to compare (binary) numbers

32 / 40

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

33 / 40

33. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

34 / 40

34. Python is a  high-level programming language.

35 / 40

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

a. 5

b. 3

c. 6

d. 7

36 / 40

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

37 / 40

37.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

38 / 40

38.

Which of the following statements assigns the value 25 to the variable x in Python:

  1. x ← 25
  2. x = 25
  3. x := 25
  4. int x = 25
  5. x << 25

39 / 40

39. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

40 / 40

40. Is there any comments in  following codes

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

 

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.