[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. Variable names are case-sensitive

2 / 40

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

3 / 40

3. Comments starts with a #

4 / 40

4. What keyword would you use to add an alternative condition to an if statement?

a) else if
b) elseif
c) elif
d) None of the above

5 / 40

5. We can combine strings and numbers by using the format() method

6 / 40

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

7 / 40

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

8 / 40

8. The elif keyword is pythons way of saying “if the previous conditions were not true, then try this condition”.

9 / 40

9. Variables that are created outside of a function

10 / 40

10. A variable name cannot start with a number

11 / 40

11.

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.

12 / 40

12. print() function is often used to output variables.

13 / 40

13. You can also have an else without the elif

14 / 40

14.

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

15 / 40

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

16 / 40

16.

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

17 / 40

17. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

18 / 40

18. Bitwise operators are used to compare (binary) numbers

19 / 40

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

20 / 40

20. Is there any comments in  following codes

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

 

21 / 40

21.

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

a. 2

b. 3

c. 5

d. Multiple times

22 / 40

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

23 / 40

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

24 / 40

24.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

25 / 40

25. Pascal Case
Each word starts with a capital letter:

26 / 40

26. The else keyword catches anything which isn’t caught by the preceding conditions.

27 / 40

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

28 / 40

28.

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.

29 / 40

29.

Which of the following precedence order is correct in Python?

  1. Parentheses, Exponential, Multiplication, Division, Addition, Subtraction
  2. Multiplication, Division, Addition, Subtraction, Parentheses, Exponential
  3. Division, Multiplication, Addition, Subtraction, Parentheses, Exponential
  4. Exponential, Parentheses, Multiplication, Division, Addition, Subtraction

30 / 40

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

31 / 40

31.

What is the value of the expression 100 / 25?

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

32 / 40

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

33 / 40

33. Python relies on indentation?

34 / 40

34.

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

35 / 40

35.

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.

36 / 40

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

37 / 40

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

38 / 40

38. Who developed Python Programming Language?

39 / 40

39. Python is an interpreted programming language

40 / 40

40.

Which statement is correct?

A. List is immutable && Tuple is mutable
B. List is mutable && Tuple is immutable
C. Both are Mutable.
D. Both are Immutable

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.