[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

2. Python can connect to database systems.

3 / 40

3.

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

a. True

b. False

4 / 40

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

5 / 40

5. Operators are used to perform operations on variables and values

6 / 40

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

7 / 40

7. You can use the pop() method to remove an element from the array

8 / 40

8.

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

a. Define

b. DEF

c. def

d. Def

9 / 40

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

10 / 40

10.

l = [ 4, 8, 9, 2.6, 5 ] is a type of which data type in python?

  1. List
  2. Tuple
  3. Set
  4. None of these

11 / 40

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

  1. d = {"john":40, "peter":45}
  2. d["john"]

a) 40
b) 45
c) “john”
d) “peter”

12 / 40

12. Extension of all Python  Programme are .py

13 / 40

13. Python is a  high-level programming language.

14 / 40

14. Python is an interpreted programming language

15 / 40

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

16 / 40

16. The length of an array is always one more than the highest array index.

17 / 40

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

18 / 40

18. Python can be install on both  Linux and  Windows

19 / 40

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

20 / 40

20.

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

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

21 / 40

21. Comments can be used to explain Python code.

22 / 40

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

23 / 40

23. The list’s remove() method only removes the first occurrence of the specified value.

24 / 40

24. Is there any comments in  following codes

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

 

25 / 40

25. Comments can be used to make the code more readable.

26 / 40

26.

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.

27 / 40

27. Variables that are created outside of a function

28 / 40

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

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32. The format() method takes the passed arguments

33 / 40

33.

What will be the output of above Python code?

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

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

34 / 40

34.

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

35 / 40

35. A variable name cannot start with a number

36 / 40

36.

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.

37 / 40

37. Find the output of the following program segments:

for i in range(20,30,2):

print(i)

a) 20 22 24 26 28

b) 20

22

24

26

28

c) 20 22 24 26 28 30

d) 20

22

24

26

28

30

38 / 40

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

39 / 40

39.

What is the value of the expression 100 / 25?

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

40 / 40

40.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

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.