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

2 / 40

2. The format() method takes the passed arguments

3 / 40

3. A variable name cannot start with a number

4 / 40

4.

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

5 / 40

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

6 / 40

6.

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.

7 / 40

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

8 / 40

8. python has two primitive loop commands:

  • while loops
  • for loops

9 / 40

9. Is there any comments in  following codes

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

 

10 / 40

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

11 / 40

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

12 / 40

12.

What is the value of the expression 100 / 25?

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

13 / 40

13. Python will give you an error if you skip the indentation

14 / 40

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

15 / 40

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

16 / 40

16. Python can connect to database systems.

17 / 40

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

18 / 40

18.

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

19 / 40

19. Python can be install on both  Linux and  Windows

20 / 40

20.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

21 / 40

21.

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

a. 2

b. 3

c. 5

d. Multiple times

22 / 40

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

23 / 40

23.

What will be the output of below Python code?

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

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

24 / 40

24. Can we write if/else into one line in python?

a) Yes
b) No
c) if/else not used in python
d) None of the above

25 / 40

25.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

26 / 40

26.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

27 / 40

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

28 / 40

28.

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

29 / 40

29.

Which function overloads the >> operator?

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

30 / 40

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

31 / 40

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

32 / 40

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

33 / 40

33. Which of the following is used to define a block of code in Python language?
a) Indentation
b) Key
c) Brackets
d) All of the mentioned

34 / 40

34. The format() method takes unlimited number of arguments

35 / 40

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

36 / 40

36. Is Python code compiled or interpreted?
a) Python code is both compiled and interpreted
b) Python code is neither compiled nor interpreted
c) Python code is only compiled
d) Python code is only interpreted

37 / 40

37. Which of the following loop is not supported by the python programming language?

a) for loop

b) while loop

c) do…while loop

d) None of the above

38 / 40

38.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

39 / 40

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

40 / 40

40. Python allows you to extract the values into variables.

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.