[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. Which of the following is False regarding loops in Python?

a)Loops are used to perform certain tasks repeatedly.

b) while loop is used when multiple statements are to executed repeatedly until the given condition becomes true.

c) while loop is used when multiple statements are to executed repeatedly until the given condition becomes false.

d) for loop can be used to iterate through the elements of lists.

3 / 40

3. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

4 / 40

4.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

5 / 40

5.

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

a. True

b. False

6 / 40

6.

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

7 / 40

7.

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

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

8 / 40

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

9 / 40

9. Find the output of the given Python program?

a, b, c = 1, 3, 5if a > 0:  if b < 2:    print("Hi")  elif c > 3:    print("Hello")else:  print("Know Program")

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

10 / 40

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

11 / 40

11.

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

12 / 40

12.

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

a. [ ]

b. { }

c. ( )

d. None of the above

13 / 40

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

14 / 40

14. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

15 / 40

15.

What is the data type of print(type(0xFF))

16 / 40

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

17 / 40

17.

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

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. Variables that are created outside of a function

22 / 40

22.

What will be the output of above Python code?

str1="6/4"print("str1")

A. 1
B. 6/4
C. 1.5
D. str1

23 / 40

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

24 / 40

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

25 / 40

25.

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

a. Define

b. DEF

c. def

d. Def

26 / 40

26. What will be the output of the following Python code?

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

27 / 40

27. Variable names are case-sensitive

28 / 40

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

29 / 40

29. Comparison operators are not  used to compare two values

30 / 40

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

31 / 40

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

32 / 40

32. Python is a  high-level programming language.

33 / 40

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

a. 5

b. 3

c. 6

d. 7

34 / 40

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

35 / 40

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

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. Who developed Python Programming Language?

38 / 40

38. python file can also run on command line

39 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

40 / 40

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

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.