[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

Which function overloads the >> operator?

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

4 / 40

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

5 / 40

5.

Python considered the character enclosed in triple quotes as String.(T/F)

a. True

b. False

6 / 40

6.

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

7 / 40

7. print() function is often used to output variables.

8 / 40

8.

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

9 / 40

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

10 / 40

10. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

11 / 40

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

12 / 40

12.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

13 / 40

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

14 / 40

14.

 Select the correct example of complex datatype in Python

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

15 / 40

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

a. 5

b. 3

c. 6

d. 7

16 / 40

16. Indentation refers to the spaces at the beginning of a code line.

17 / 40

17.

What will be the output of below Python code?

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

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

18 / 40

18. Python can connect to database systems.

19 / 40

19.

Which is the correct operator for power(xy)?

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

20 / 40

20. Python can be install on both  Linux and  Windows

21 / 40

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

22 / 40

22.

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

23 / 40

23. Python has various versions available

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. Comments starts with a #

26 / 40

26. A variable name cannot start with a number

27 / 40

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

28 / 40

28.

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.

29 / 40

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

30 / 40

30.

 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.

31 / 40

31.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

32 / 40

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

33 / 40

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

34 / 40

34.

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

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

35 / 40

35. Python is a  high-level programming language.

36 / 40

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

37 / 40

37. With the break statement we can stop the loop even if the while condition is true

38 / 40

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

39 / 40

39.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

40 / 40

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

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.