[miniorange_social_sharing]
[TheChamp-Login]

/40

Final Exam for Python for Everyone (A to Z)

BEST OF LUCK!!!

1 / 40

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

2 / 40

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

3 / 40

3.

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

a. 2

b. 3

c. 5

d. Multiple times

4 / 40

4. Python relies on indentation?

5 / 40

5. An example of an illegal character is a double quote inside a string that is surrounded by double quotes

6 / 40

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

7 / 40

7.

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

8 / 40

8.

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

9 / 40

9. Suppose t = (1, 2, 4, 3), which of the following is incorrect?
a) print(t[3])
b) t[3] = 45
c) print(max(t))
d) print(len(t))

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. During Installation Make sure to select both the checkboxes at the bottom .

12 / 40

12.  ________ in Python is a counter-controlled loop.

a) for

b) while

c) Both (a) and (b)

d) None of the above

13 / 40

13. Who developed Python Programming Language?

14 / 40

14. Comments can be used to make the code more readable.

15 / 40

15. Variable names are case-sensitive

16 / 40

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

17 / 40

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

18 / 40

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

19 / 40

19.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

20 / 40

20. Python can be install on both  Linux and  Windows

21 / 40

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

22 / 40

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

23 / 40

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

24 / 40

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

25 / 40

25. You can also have an else without the elif

26 / 40

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

27 / 40

27. Most recent major version of Python is Python 3

28 / 40

28.

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

29 / 40

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

30 / 40

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

31 / 40

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

32 / 40

32.

What will be the output of below Python code?

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

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

33 / 40

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

34 / 40

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

35 / 40

35. Strings in python are surrounded by either single quotation marks, or double quotation marks

36 / 40

36.

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

a. True

b. False

37 / 40

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

 

38 / 40

38.

 Select the correct example of complex datatype in Python

  1. 3 + 2j
  2. -100j
  3. 5j
  4. All of the above are correct

39 / 40

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

40 / 40

40.

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

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

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.