[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

a. 5

b. 3

c. 6

d. 7

5 / 40

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

6 / 40

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

7 / 40

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

8 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

9 / 40

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

10 / 40

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

11 / 40

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

12 / 40

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

13 / 40

13. The format() method takes the passed arguments

14 / 40

14. Snake Case
Each word is separated by an underscore character:

15 / 40

15.

Which function overloads the >> operator?

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

16 / 40

16. Comments can be used to explain Python code.

17 / 40

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

18 / 40

18. python file can also run on command line

19 / 40

19. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

20 / 40

20. The len() method to return the length of an array

21 / 40

21. A variable name cannot start with a number

22 / 40

22.

What will be the output of below Python code?

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

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

23 / 40

23. Strings in python are surrounded by either single quotation marks, or double quotation marks

24 / 40

24.

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

25 / 40

25.

Which is the correct operator for power(xy)?

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

26 / 40

26.

What will be the output of above Python code?

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

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

27 / 40

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

28 / 40

28.

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

a. 2

b. 3

c. 5

d. Multiple times

29 / 40

29. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

30 / 40

30.

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

31 / 40

31. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

32 / 40

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

33 / 40

33.

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.

34 / 40

34. Python is an interpreted programming language

35 / 40

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

36 / 40

36. Extension of all Python  Programme are .py

37 / 40

37.

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

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

38 / 40

38. 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)

39 / 40

39. Pip is  not a powerful package management system for Python software packages

40 / 40

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

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.