The Joy of Computing Using Python Week 3 Solutions 2024

ABOUT THE COURSE :

The Joy of Computing Using Python Week 3 Solutions 2024

Disclaimer: The answers to these questions are provided for educational and informational purposes only. This website does not claim any surety of 100% correct answers. So, this website urges you to complete your assignment yourself.

A fun filled whirlwind tour of 30 hrs, covering everything you need to know to fall in love with the most sought after skill of the 21st century. The course brings programming to your desk with anecdotes, analogies and illustrious examples. Turning abstractions to insights and engineering to art, the course focuses primarily to inspire the learner's mind to think logically and arrive at a solution programmatically. As part of the course, you will be learning how to practice and culture the art of programming with Python as a language. At the end of the course, we introduce some of the current advances in computing to motivate the enthusiastic learner to pursue further directions.

Summary
Course Type Elective
Duration 12 weeks
Category Computer Science and Engineering
Start Date 22 Jan 2024
End Date 12 Apr 2024
Exam Registration Ends 16 Feb 2024
Exam Date 21 Apr 2024 IST

Assignment Solutions : Programming Assignment :

1. Programming Assignment | Week 3 :
You are given a list marks that has the marks scored by a class of students in a Mathematics test. Find the median marks and store it in a float variable named median. You can assume that marks is a list of float values.
Procedure to find the median
(1) Sort the marks in ascending order. Do not try to use built-in methods.
(2) If the number of students is odd, then the median is the middle value in the sorted sequence. If the number of students is even, then the median is the arithmetic mean of the two middle values in the sorted sequence.
You do not have to accept input from the console as it has already been provided to you. You do not have to print the output to the console. Input-Output is the responsibility of the auto-grader for this problem.
FILL THE MISSING CODE
    for i in range(0, len(marks)):
        for j in range(i+1, len(marks)):
            if marks[i] >= marks[j]:
                marks[i], marks[j] = marks[j],marks[i]
              
    #print(marks)          
    m=len(marks)//2
    if len(marks)%2!=0:
      median=marks[m]
    else:
      median=(marks[m-1]+marks[m])/2
2. Programming Assignment | Week 3
Accept a string as input, convert it to lower case, sort the string in alphabetical order, and print the sorted string to the console. You can assume that the string will only contain letters.
get=input()
get=get.lower()
print("".join(sorted(get)),end="")
3. Programming Assignment | Week 3
Due on 2024-02-15, 23:59 IST You are given the dates of birth of two persons, not necessarily from the same family. Your task is to find the younger of the two. If both of them share the same date of birth, then the younger of the two is assumed to be that person whose name comes first in alphabetical order (names will follow Python's capitalize case format).

The input will have four lines. The first two lines correspond to the first person, while the last two lines correspond to the second person. For each person, the first line corresponds to the name and the second line corresponds to the date of birth in DD-MM-YYYY format. Your output should be the name of the younger of the two.
person1=input()
dob1=input()
person2=input()
dob2=input()
year1=int(dob1.split('-')[2])
year2=int(dob2.split('-')[2])
month1=int(dob1.split('-')[1])
month2=int(dob2.split('-')[1])
day1=int(dob1.split('-')[0])
day2=int(dob2.split('-')[0])

if (year1>year2):
  print(person1,end="")
elif (year2>year1):
  print(person2,end="")
else:
  if(month1>month2):
    print(person1,end="")
  elif(month2>month1):
    print(person2,end="")
  else:
    if(day1>day2):
      print(person1,end="")
    elif(day2>day1):
      print(person2,end="")
    else:
      print(min(person1,person2),end="")

CRITERIA TO GET A CERTIFICATE :
  1. Average assignment score = 25% of average of best 8 assignments out of the total 12 assignments given in the course.
  2. Exam score = 75% of the proctored certification exam score out of 100
  3. Final score = Average assignment score + Exam score
YOU WILL BE ELIGIBLE FOR A CERTIFICATE ONLY IF AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If one of the 2 criteria is not met,you will not get the certificate even if the Final score >= 40/100.

Join With Us On :

Join Now


Previous Year Questions Now to Boost Your Exam Performance

LOADS OF LOGIC