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

A. String is immutable.
B. capitalize() function in string is used to return a string by converting the whole given string into uppercase.
C. lower() function in string is used to return a string by converting the whole given string into lowercase.
D. None of these.

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

6 / 40

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

7 / 40

7. You can also have multiple else statements on the same line:

8 / 40

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

9 / 40

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

10 / 40

10. You can use the append() method to add an element to an array

11 / 40

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

12 / 40

12. A variable name cannot start with a number

13 / 40

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

14 / 40

14.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

15 / 40

15. Python can connect to database systems.

16 / 40

16.

Choose the correct option with respect to Python.

A. Both tuples and lists are immutable.
B. Tuples are immutable while lists are mutable.
C. Both tuples and lists are mutable.
D. Tuples are mutable while lists are immutable.

17 / 40

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

18 / 40

18. Python  was created by Guido van Rossum, and released in 1999.

19 / 40

19. Comments can be used to explain Python code.

20 / 40

20. Python is a  high-level programming language.

21 / 40

21.

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

22 / 40

22.

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

23 / 40

23.

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

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

24 / 40

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

25 / 40

25.

 ____________________ 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

26 / 40

26. Python is an interpreted programming language

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

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

x = ['ab', 'cd']for i in x:    i.upper()print(x)

a) [‘ab’, ‘cd’]
b) [‘AB’, ‘CD’]
c) [None, None]
d) none of the mentioned

31 / 40

31. Is there any comments in  following codes

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

 

32 / 40

32. Python has various versions available

33 / 40

33. Variable names are case-sensitive

34 / 40

34.

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

a. True

b. False

35 / 40

35.

Which is the correct operator for power(xy)?

  1. X^y
  2. X**y
  3. X^^y
  4. None of the mentioned

36 / 40

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

37 / 40

37.

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

38 / 40

38. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

39 / 40

39.

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

a. 2

b. 3

c. 5

d. Multiple times

40 / 40

40. Find and write the output of the following python code:

x = “abcdef”

i = “a”

while i in x:

print(i, end = ” “)

a) a

b) a a a a a a

c) a a a a a a … infinite times

d) Code will generate error

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.