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

2 / 40

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

3 / 40

3.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

4 / 40

4. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

5 / 40

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

6 / 40

6. Python is an interpreted programming language

7 / 40

7. Variables that are created outside of a function

8 / 40

8. Comments starts with a #

9 / 40

9. Python has a set of built-in methods that you can use on lists/arrays

10 / 40

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

11 / 40

11.

What will be the output of below Python code?

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

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

12 / 40

12.

Which function overloads the >> operator?

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

13 / 40

13. An array can hold many values under a single name

14 / 40

14.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

15 / 40

15.

What is the value of the expression 100 / 25?

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

16 / 40

16.

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

17 / 40

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

i = 1while True:    if i%3 == 0:        break    print(i)     i + = 1

a) 1 2
b) 1 2 3
c) error
d) none of the mentioned

18 / 40

18. The format() method takes the passed arguments

19 / 40

19. Python can connect to database systems.

20 / 40

20.

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

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

21 / 40

21. With the break statement we can stop the loop even if the while condition is true

22 / 40

22.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

23 / 40

23.

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

24 / 40

24.

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

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

25 / 40

25.

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

a. 2

b. 3

c. 5

d. Multiple times

26 / 40

26.

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

27 / 40

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

28 / 40

28. Who developed Python Programming Language?

29 / 40

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

30 / 40

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

31 / 40

31.

 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.

32 / 40

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

33 / 40

33. Extension of all Python  Programme are .py

34 / 40

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

35 / 40

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

36 / 40

36.

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

a. Define

b. DEF

c. def

d. Def

37 / 40

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

38 / 40

38. Bitwise operators are used to compare (binary) numbers

39 / 40

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

40 / 40

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

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.