[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

 What is output of: 35 == 35.0

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

4 / 40

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

5 / 40

5.

def cal(n1) : What is n1?

a. Parameter

b. Argument

c. Keyword

d. None of the above

6 / 40

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

7 / 40

7. Python can be install on both  Linux and  Windows

8 / 40

8.

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

9 / 40

9. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

10 / 40

10. Indentation refers to the spaces at the beginning of a code line.

11 / 40

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

12 / 40

12.

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

13 / 40

13. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

14 / 40

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

15 / 40

15. The format() method takes the passed arguments

16 / 40

16.

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

a. 2

b. 3

c. 5

d. Multiple times

17 / 40

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

18 / 40

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

19 / 40

19. Python can connect to database systems.

20 / 40

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

21 / 40

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

22 / 40

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

23 / 40

23. Python is an interpreted programming language

24 / 40

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

25 / 40

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

26 / 40

26. A variable name must start with a letter or the underscore character

27 / 40

27. break in Python is used ______________

a) To restart a loop

b) Terminate a loop

c) To jump in between the loop

d) None of the above

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

 

30 / 40

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

31 / 40

31. Comments can’t be used to prevent execution when testing code.

32 / 40

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

33 / 40

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

34 / 40

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

35 / 40

35.

Which function overloads the >> operator?

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

36 / 40

36.

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.

37 / 40

37.

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.

38 / 40

38.

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

39 / 40

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

40 / 40

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

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.