[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

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

4 / 40

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

5 / 40

5. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

6 / 40

6. Variable names are case-sensitive

7 / 40

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

8 / 40

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

9 / 40

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

10 / 40

10.

Following is an example of ___________________

sv = “csiplearninghub.com”

a. List

b. String

c. Dictionary

d. None of the above

11 / 40

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

12 / 40

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

13 / 40

13. A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).

14 / 40

14.

 What is output of: 35 == 35.0

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

15 / 40

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

16 / 40

16. You can also have an else without the elif

17 / 40

17. Comparison operators are not  used to compare two values

18 / 40

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

19 / 40

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

20 / 40

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

21 / 40

21. Python can be used to handle big data and perform complex mathematics.

22 / 40

22. You can return a range of characters by using the slice syntax

23 / 40

23.

In the Python statement x = a + 5 – b:

a and b are ________a + 5 - b is ________
  1. terms, a group
  2. operators, a statement
  3. operands, an expression
  4. operands, an equation

24 / 40

24. python has two primitive loop commands:

  • while loops
  • for loops

25 / 40

25. python file can also run on command line

26 / 40

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

27 / 40

27.

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

28 / 40

28.

 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.

29 / 40

29. The for loop does not require an indexing variable to set beforehand

30 / 40

30. Official site of python is www.python.org

31 / 40

31.

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

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

32 / 40

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

33 / 40

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

34 / 40

34.

What will be the output of below Python code?

str1="poWer"str1.upper()print(str1)

A. POWER
B. Power
C. power
D. poWer

35 / 40

35.

 ____________________ 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

36 / 40

36. The format() method takes the passed arguments

37 / 40

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

38 / 40

38.

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

39 / 40

39. A loop block in python starts with a –

a) ; (semicolon)

b) , (comma)

c) : (colon)

d) # (hash)

40 / 40

40. Python is a  high-level programming language.

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.