[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1.

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

a. [ ]

b. { }

c. ( )

d. None of the above

2 / 40

2.

What will be the output of below Python code?

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

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

3 / 40

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

4 / 40

4.

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

a. Define

b. DEF

c. def

d. Def

5 / 40

5.

What will be the output of above Python code?

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

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

6 / 40

6. python file can also run on command line

7 / 40

7. When does the else statement written after loop executes?

a) When loop condition becomes false

b) When break statement is executed in the loop

c) else statement is always executed

d) None of the above

8 / 40

8.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

9 / 40

9.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

10 / 40

10.

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

11 / 40

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

12 / 40

12. The format() method takes the passed arguments

13 / 40

13.

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

14 / 40

14. Who developed Python Programming Language?

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. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

17 / 40

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

18 / 40

18.

 What is output of: 35 == 35.0

  1. False
  2. True
  3. 33
  4. None of the above

19 / 40

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

20 / 40

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

21 / 40

21. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

22 / 40

22. Official site of python is www.python.org

23 / 40

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

24 / 40

24.

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

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. Variables that are created outside of a function

27 / 40

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

28 / 40

28. Comments can be used to explain Python code.

29 / 40

29.

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

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

30 / 40

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

31 / 40

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

32 / 40

32.

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

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

33 / 40

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

34 / 40

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

35 / 40

35. Python is a  high-level programming language.

36 / 40

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

37 / 40

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

38 / 40

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

39 / 40

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

40 / 40

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

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.