[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. Comments starts with a #

3 / 40

3. What is the index value of ‘i’ in string “Learning”

a. 5

b. 3

c. 6

d. 7

4 / 40

4.

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

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

5 / 40

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

6 / 40

6. Most recent major version of Python is Python 3

7 / 40

7.

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

8 / 40

8.

Write the output of the following code :

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

a. Weacome

b. Error

c. aWelcome

d. Welcomea

9 / 40

9.

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

10 / 40

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

11 / 40

11.

Which keyword is used to begin the definition of a function?

a. Define

b. DEF

c. def

d. Def

12 / 40

12.

Which function overloads the >> operator?

  1. more()
  2. gt()
  3. ge()
  4. None of the above

13 / 40

13.

 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.

14 / 40

14. The length of an array is always one more than the highest array index.

15 / 40

15.

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

16 / 40

16. The for loop in Python is an _____________

a) Entry Controlled Loop

b) Exit Controlled Loop

c) Both of the above

d) None of the above

17 / 40

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

18 / 40

18.

 What is output of: 35 == 35.0

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

19 / 40

19. Indentation refers to the spaces at the beginning of a code line.

20 / 40

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

21 / 40

21. Comments can be used to explain Python code.

22 / 40

22. python file can also run on command line

23 / 40

23. Variables that are created outside of a function

24 / 40

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

25 / 40

25. Extension of all Python  Programme are .py

26 / 40

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

27 / 40

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

28 / 40

28. python has two primitive loop commands:

  • while loops
  • for loops

29 / 40

29. Is there any comments in  following codes

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

 

30 / 40

30.

What will be the output of below Python code?

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

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

31 / 40

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

32 / 40

32. The format() method takes the passed arguments

33 / 40

33. The format() method takes unlimited number of arguments

34 / 40

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

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. What is another word for ‘iteration’ ?

a) Selection

b) Assignment

c) Sequencing

d) Repetition

37 / 40

37.

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

38 / 40

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

39 / 40

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

40 / 40

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

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.