[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

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

a. [ ]

b. { }

c. ( )

d. None of the above

4 / 40

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

5 / 40

5. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

6 / 40

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

7 / 40

7. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

8 / 40

8. Who developed Python Programming Language?

9 / 40

9. Python can be install on both  Linux and  Windows

10 / 40

10. You can also use the remove() method to remove an element from the array

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.

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.

13 / 40

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

14 / 40

14.

What will be the output of below Python code?

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

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

15 / 40

15.

Which of the following statement will execute in last?

def s(n1): #Statement 1      print(n1) #Statement 2n2=4 #Statement 3s(n2) #Statement 4

a. Statement 1

b. Statement 2

c. Statement 3

d. Statement 4

16 / 40

16.

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

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

17 / 40

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

18 / 40

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

19 / 40

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

20 / 40

20.

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

a. True

b. False

21 / 40

21.

 ____________________ 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

22 / 40

22. Variables that are created outside of a function

23 / 40

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

24 / 40

24. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

25 / 40

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

26 / 40

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

27 / 40

27.

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.

28 / 40

28.

How to copy one list to another in python?

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

29 / 40

29.

What is the value of the expression 100 / 25?

  1. 4
  2. 4.0
  3. 0
  4. 25

30 / 40

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

31 / 40

31. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

32 / 40

32.

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

33 / 40

33. Python is an interpreted programming language

34 / 40

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

35 / 40

35.

 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.

36 / 40

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

37 / 40

37. With the for loop we can execute a set of statements

38 / 40

38. python has two primitive loop commands:

  • while loops
  • for loops

39 / 40

39.

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

40 / 40

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

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.