[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3. Which of the following is the use of function in python?
a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

4 / 40

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

5 / 40

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

6 / 40

6.

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.

7 / 40

7. All keywords in Python are in _________
a) Capitalized
b) lower case
c) UPPER CASE
d) None of the mentioned

8 / 40

8.

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

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

9 / 40

9.

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

a. True

b. False

10 / 40

10. You can use the pop() method to remove an element from the array

11 / 40

11. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

12 / 40

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

13 / 40

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

14 / 40

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

15 / 40

15. Variable names are case-sensitive

16 / 40

16. Find the output of the given Python program?

a = 25if a < 15:    print("Hi")if a <= 30:    print("Hello")else:    print("Know Program")

a) Hi
b) Hello
c) Know Program
d) Compiled Successfully, No Output.

17 / 40

17.

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

a. 2

b. 3

c. 5

d. Multiple times

18 / 40

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

19 / 40

19. Python has a set of built-in methods that you can use on lists/arrays

20 / 40

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

21 / 40

21. Python is a  high-level programming language.

22 / 40

22.

Which of the following statement is a function call?

a. call sum( )

b. def sum( )

c. sum( )

d. function sum( )

23 / 40

23.

What will be the output of below Python code?

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

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

24 / 40

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

25 / 40

25. Who developed Python Programming Language?

26 / 40

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

27 / 40

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

28 / 40

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

29 / 40

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

30 / 40

30. With the break statement we can stop the loop before it has looped through all the items

31 / 40

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

32 / 40

32. You can also have an else without the elif

33 / 40

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

34 / 40

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

35 / 40

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

36 / 40

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

37 / 40

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

38 / 40

38. Which of the following is the correct extension of the Python file?

39 / 40

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

40 / 40

40.

 What is output of: 35 == 35.0

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

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.