[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

3 / 40

3. Variables that are created outside of a function

4 / 40

4.

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

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

5 / 40

5.

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

a. 2

b. 3

c. 5

d. Multiple times

6 / 40

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

7 / 40

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

8 / 40

8.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

9 / 40

9.

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

a. [ ]

b. { }

c. ( )

d. None of the above

10 / 40

10. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

11 / 40

11. Extension of all Python  Programme are .py

12 / 40

12.

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

13 / 40

13.

Which is the correct operator for power(xy)?

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

14 / 40

14. Is there any comments in  following codes

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

 

15 / 40

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

16 / 40

16.

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

17 / 40

17. To insert characters that are illegal in a string, use an escape character

18 / 40

18. Comments starts with a #

19 / 40

19.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

20 / 40

20.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

21 / 40

21. python file can also run on command line

22 / 40

22. Who developed Python Programming Language?

23 / 40

23.

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

24 / 40

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

25 / 40

25. python has two primitive loop commands:

  • while loops
  • for loops

26 / 40

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

27 / 40

27. What is the output of the given below program?

if 1 + 3 == 7:    print("Hello")else:    print("Know Program")

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

28 / 40

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

29 / 40

29. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

30 / 40

30. The format() method takes the passed arguments

31 / 40

31.

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

32 / 40

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

33 / 40

33.

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

34 / 40

34. Python has various versions available

35 / 40

35.

Which one of the following is the correct extension of the Python file?

  1. .py
  2. .python
  3. .p
  4. None of these

36 / 40

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

37 / 40

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

38 / 40

38.

Which function overloads the >> operator?

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

39 / 40

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

40 / 40

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

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.