[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

1. python file can also run on command line

2 / 40

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

3 / 40

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

4 / 40

4.

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

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

5 / 40

5.

 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.

6 / 40

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

7 / 40

7. Extension of all Python  Programme are .py

8 / 40

8. Which of the following is a Python tuple?
a) [1, 2, 3]
b) (1, 2, 3)
c) {1, 2, 3}
d) {}

9 / 40

9.

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

a. True

b. False

10 / 40

10. Who developed Python Programming Language?

11 / 40

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

12 / 40

12.

Write the output of the following code :

str = "Welcome"str[2] = 'a'print(str)

a. Weacome

b. Error

c. aWelcome

d. Welcomea

13 / 40

13.

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.

14 / 40

14.

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

15 / 40

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

16 / 40

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

17 / 40

17. Python can be treated in a procedural way, an object-oriented way or a functional way.

18 / 40

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

19 / 40

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

20 / 40

20. Comparison operators are not  used to compare two values

21 / 40

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

22 / 40

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

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.

What is the data type of print(type(0xFF))

25 / 40

25.

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

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

29. With the for loop we can execute a set of statements

30 / 40

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

31 / 40

31. Python will give you an error if you skip the indentation

32 / 40

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

33 / 40

33.

What will be the output of below Python code?

str1="Information"print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

37.

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

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

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. Python has syntax that allows developers to write programs with fewer lines than some other programming languages.

40 / 40

40.

What is the value of the expression 100 / 25?

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

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.