Showing posts with label Python Solutions. Show all posts
Showing posts with label Python Solutions. Show all posts

Sunday, October 6

PYTHON IMPORTANT QUESTIONS FOR FINAL EXAM

 Important Questions For Final Exam 





Question 1.
def both_start_with(s1, s2, prefix)
'''(str, str, str) -> bool
Return True if and only if s1 and s2 both start with the letters in prefix. ''' if s1.startswith(prefix) and s2.startswith(prefix): return True else:

Saturday, October 5

PYTHON PREVIOUS YEAR PAPER WITH SOLUTIONS

PYTHON PREVIOUS YEAR QUESTION PAPER

(For Solutions See Bottom!!)



Final Exam (3 hours and 1 attempt)

Question 1
Select the expression(s) that evaluate to a float value.
3 // 4
8 % 6
8.0 % 4
3 / 4

Monday, September 30

Python Week 6 Solutions

Learn to Program: The Fundamentals - Week 6 Exercise

Score of 13.00 out of 13.00

Open up IDLE and try out all the code as you do the exercise!

Question 1

Consider this code:
def merge(L):
    merged = []
    for i in range(0, len(L), 3):
        merged.append(L[i] + L[i + 1] + L[i + 2])
    return merged

print(merge([1, 2, 3, 4, 5, 6, 7, 8, 9]))
What is printed by the code above?
Your Answer
ScoreExplanation
[123, 456, 789]


[1, 4, 7]


[6, 15, 24]Correct1.00
[12, 15, 18]


Total
1.00 / 1.00