[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2.

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

a. 2

b. 3

c. 5

d. Multiple times

3 / 40

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

4 / 40

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

5 / 40

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

6 / 40

6. 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”

7 / 40

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

8 / 40

8.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

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

11 / 40

11.

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

a. Define

b. DEF

c. def

d. Def

12 / 40

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

13 / 40

13. python has two primitive loop commands:

  • while loops
  • for loops

14 / 40

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

15 / 40

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

16 / 40

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

17 / 40

17.

How to copy one list to another in python?

A. l1[] = l2[]
B. l1[] = l2
C. l1[] = l2[:]
D. l1 = l2

18 / 40

18.

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

19 / 40

19. Python relies on indentation?

20 / 40

20. Camel Case
Each word, except the first, starts with a capital letter:

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

24.

Which function overloads the >> operator?

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

25 / 40

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

26 / 40

26.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

27 / 40

27. Python is a  high-level programming language.

28 / 40

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

29 / 40

29.

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

30 / 40

30. Python has various versions available

31 / 40

31. Extension of all Python  Programme are .py

32 / 40

32. Comments can be used to explain Python code.

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

36. During Installation Make sure to select both the checkboxes at the bottom .

37 / 40

37.

 ____________________ can be defined as a named group of instructions that accomplish a specific task when it is invoked/called.

a. Function

b. Datatype

c. Token

d. Operator

38 / 40

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

a) for

b) while

c) Both (a) and (b)

d) None of the above

39 / 40

39.

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

40 / 40

40.

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.

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.