[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Who developed Python Programming Language?

2 / 40

2. X wants to allow the program to repeatedly ask the user to enter their Choice if it does not equal the Answer. Which loop option should X use?

a) while Choice == Answer:

Choice = input()

b) while Choice != Answer:

Choice = input()

c) while Answer != Choice:

Choice = input()

d) while Answer =! Choice:

Choice = input()

 

3 / 40

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

4 / 40

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

5 / 40

5. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

6 / 40

6. Python can be used on a server to create web applications?

7 / 40

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

8 / 40

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

9 / 40

9. A variable name cannot start with a number

10 / 40

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

11 / 40

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

12 / 40

12. Python can connect to database systems.

13 / 40

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

14 / 40

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

15 / 40

15. Arrays are used to store multiple values in one single variable.

16 / 40

16.

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

a. Define

b. DEF

c. def

d. Def

17 / 40

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

18 / 40

18.

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.

19 / 40

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

20 / 40

20. Python can be install on both  Linux and  Windows

21 / 40

21.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

22 / 40

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

23 / 40

23.

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.

24 / 40

24.

 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.

25 / 40

25. Comparison operators are not  used to compare two values

26 / 40

26.

 What is output of: 35 == 35.0

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

27 / 40

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

28 / 40

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

29 / 40

29. Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location

30 / 40

30.

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.

31 / 40

31. You can also have an else without the elif

32 / 40

32.

The most important object defined in NumPy is an N-dimensional array type called?

A. ndarray
B. narray
C. nd_array
D. darray

33 / 40

33. if statements cannot be empty, but if you for some reason have an if statement with no content, put in the pass statement to avoid getting an error

34 / 40

34. Python has various versions available

35 / 40

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

36 / 40

36. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

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. The len() method to return the length of an array

39 / 40

39. Is there any comments in  following codes

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

 

40 / 40

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

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.