Ask Question
12 September, 00:09

Show how to define a view tot_credits (year, num_credits), giving the total number of credits taken by students in each year

+5
Answers (1)
  1. 12 September, 00:22
    0
    Hi! I'm a Digital Marketer Intern at hotels. ng and I have a moderate knowledge on programming.

    First, your question is not very explanatory. The term "view" is often used in back-end web development. A view is simply a Python function that takes a Web request and returns a Web response.

    But I'm not sure this is what you want, so I'll just go ahead and write a python function involving class to return the total number of credits taken by a student.

    I'll answer this question using Python.

    class student (object):

    credits = None

    year = None

    def num_credits (self):

    #get credit value

    self. credits = input ("Enter the total number of credits: ")

    pass

    def getYear (self):

    self. year = input ("Enter current year: ")

    pass

    def tot_credits (self):

    TotalCredits = tempTotalCredits + self. num_credits

    print "Your total credits are : "+" "+str (TotalCredits)
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Show how to define a view tot_credits (year, num_credits), giving the total number of credits taken by students in each year ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers