Day name 2 in python assignment expert

Day Name - 2

Given the weekday of the first day of the month, determine the day of the week of the given date in that month.

Input

The first line is a string

D. The second line is an integer N.Output

The output should be a string.

Explanation

In the given example,

D = Monday. As the 1st of the day of the month is a Monday, it means the 7th and 14th of the month will be Sundays [A week has 7 days]. So the 16th day [N = 16] of the month will be a Tuesday.So, the output should be

Tuesday.

Day Name - 2

Given the weekday of the first day of the month, determine the day of the week of the given date in that month.

The first line is a string

The output should be a string.

In the given example,

D = Monday. As the 1st of the day of the month is a Monday, it means the 7th and 14th of the month will also be Mondays [A week has 7 days]. So the 16th day [N = 16] of the month will be a Tuesday.So, the output should be

Tuesday.

Sample Input 1

Monday

16

Output:

Tuesday

sample Input-2:

Tuesday

17

Output:

Thursday

def determine_day_by_number[start_day: str, month_day_number: int]:
    number_to_day = dict[
        [[1, 'Monday'], [2, 'Tuesday'], [3, 'Wednesday'], [4, 'Thursday'], [5, 'Friday'], [6, 'Saturday'],
         [7, 'Sunday']]]
    day_to_number = dict[zip[number_to_day.values[], number_to_day.keys[]]]

    if start_day not in number_to_day.values[]:
        print['Wrong day name']
        exit[]

    start_day_number = day_to_number[start_day]
    shift = get_day_shift[start_day_number, month_day_number]
    number_of_required_day = start_day_number + shift

    return number_to_day[number_of_required_day]


def get_day_shift[start_day_number: int, month_day_number: int]:
    shift = month_day_number
    if start_day_number + shift > 7:
        number_of_full_weeks = shift // 7
        shift -= 7 * number_of_full_weeks + 1
    return shift if not start_day_number + shift > 7 else shift - 7


def main[]:
    start_day = input['Enter start day: ']
    month_day_number = int[input['Enter shift number: ']]

    day = determine_day_by_number[start_day, month_day_number]
    print[day]


if __name__ == '__main__':
    main[]

Assignments » Conditional Structures »  Set 1  »  Solution 8

Write a program that prompts the user to input a number. Program should display the corresponding days to the number. For example if user type 1 the output should be sunday. If user type 7 the output should be saturday.

Source Code

day= int[input["Enter a number 1-7 : "]]

if [day==1]:
    print[day," is Sunday"]
elif [day==2]:
    print[day," is Monday"]
elif [day==3]:
    print[day," is Tuesday"]
elif [day==4]:
    print[day," is Wednesday"]
elif [day==5]:
    print[day," is Thursday"]
elif [day==6]:
    print[day," is Friday"]
elif [day==7]:
    print[day," is Saturday"]
else:
    print["Wrong Input!!!!!"]

Output

Enter a number 1-7 : 5
5 is Thursday

Python as a programming language comprises too many critical facets to analyse and solve from time to time. Unless you are well-aware of the technical nitty-gritty of the programming essentials, you cannot and should not approach an assignment right away, Now, in case, you are dealing with programming challenges and looking for someone to back you up with Python programming assignment help online, take a look here.

MyAssignmenthelp.comis available round the clock at your service. All you need to do is get in touch with us during any time of the day, place your order and allow our Python programming assignment help experts to back you up with comprehensive assistance on the go.

Comprehensive Python Programming Assignment Help Under One Roof

As mentioned, Python, as a programming language, is widely spread across a myriad of key functional areas. So, we have geared up accordingly to back you up with comprehensive help with Python programming assignments across all critical areas of technicality.

Take a look below to gain more insights.

  • Each local variable is referenced before composing assignment on Python
  • We are dedicated to composing a well-framed introduction to data science in pythonassignment 3 with flawless solutions
  • You get to receive Internshala python assignment solutions as well.
  • Also, we are here to provide you with data visualisation with the final python assignment.
  • If you need Coursera python assignment solutions, get in touch with us right away.
  • From Python multiple variable assignments to Python multiple variable assignments with the same value, we are here to back you up with a wide array of academic assistance.

Now that you know about our potential and how diligently we would work to help you secure the top spot in class, waste no time further and get in touch with us. Our Python coding helpers shall leave no loose ends to cover you up with solutions that will make an impression of excellence on your professors.

Get in Touch

“Who will help me with Python Assignment on Time?”

Do you have a narrow deadline? Is there a pending set of Python assignments? Looking for the right resources and failing to accumulate the same? Wondering, “Who will help me with Python assignment on time?”

Worry no more. MyAssignmenthelp.com has got you covered. Our team of Python coding helpers know how to work on each assignment with precision and wrap them up much ahead of the actual deadline.

Here’s a glimpse of how we work.

  • We are committed to finishing off each assignment and moving on to the next set on the successful delivery of the previous paper.
  • Our Python programming assignment experts are provided with peaceful environments to focus on the task and wrap up the same on time. .
  • Most importantly, the Python assignment help experts know how to set their own deadlines and meet the same, even before the student sets a reminder.

So, when are you ordering your Python assignment with us? Hurry up! You are only a few clicks away from taking home well-knit assignments, ahead of the estimated date of submission.

Click to Connect

Brilliant Academic Assistance Across a Myriad of Python Assignment Questions

You must be wondering about the topics or the Python assignment questions MyAssignmenthelp.com will be covering for you. So, here’s a glimpse of the most sought-after Python assignment topics and questions our experts are capable of solving.

  • What is a dynamically typed language in Python?
  • What are the major benefits of Python as a programming language?
  • What is PEP 8 and what is its significance?
  • How is memory managed in Python programming language?
  • What is scope resolution in Python?
  • What are the decorators, lists and tuples in Python?
  • What do you mean by Dict and List comprehensions?

While these are only few of the many Python assignment questions, we will be covering for you, connect with us right away and get assisted across other sets of questionnaires.

Click to Proceed

Diligent Python Programming Assignment Help Experts at Work

The subject matter of Python programming is challenging on different levels. It is basically an interpreted high-level general purpose programming language. Being one of the most popular programming languages, Python is being taught across all academic institutes these days.

So, it goes without saying, you would definitely look for the best writer to work on the assignment.

Now, that you have visited MyAssignmenthelp.com, go stress-free. Here is a snippet of our pool of Python programming help experts, available round the clock.

  • Subject matter experts specialising in delivering Nptel Python assignment solutions, variables, operators and more
  • Native programming experts with extensive knowledge across Python assignment on operators, multiple and Tuple assignment in Python
  • Former professors of Computer Science with sheer insights into the nitty-gritty of programming essentials

So, without much ado, simply get in touch with our Python programming assignment help experts right away, and receive technically flawless solutions on time.

Hire an Expert

Most Frequently Asked Questions by Students on Python assignment help

Q.1. What is assignment statement in python?

Ans: Assignment statement in Python is basically a statement that assigns a value to a name [variable]. It is said that the expression must be compatible with the type of variable.

Q.2.  How do you write an assignment in Python?

Ans: Here’s how you should write an assignment in Python:

  • Focus on the primary question.
  • See what programming essentialities the topic asks you to implement.
  • Create a clear and transparent flowchart in your mind.
  • Now, abide by the basics of Python programming and write the code.
  • Rerun the code for confirmation and submit the paper once confirmed.

Q.3. How do I get help with Python assignment?

Ans: The trick is simple. Get in touch with MyAssignmenthelp.com, place your order, mention all requirements and make payment. That’s all. Our in-house experts shall provide you with comprehensive Python assignment help.

Q.4. Which is the most accurate model of assignment in python?

Ans: Sticky note is said to be the most accurate model of assignment in Python.

Q.5. Why does assignment evaluate as true in python?

Ans: If two Boolean values are true and false in Python, the expression can evaluate to true under certain conditions and technical evaluations.

Q.6. Which is not a valid assignment operator in python?

Ans: The “not operator” in Python is said to be the only unary Boolean operator implemented in programming.

How do I print the number of days in a month in Python?

Suppose we have one year Y and a month M, we have to return the number of days of that month for the given year..
if m = 2, then. if y is a leap year, return 29, otherwise 28..
make an array with elements [1,3,5,7,8,10,12].
if m is in the list, then return 31, otherwise, return 30..

What kind of language is Python?

Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes.

How do you print a diamond crystal in Python?

To create a diamond pattern in Python using a for loop, use this simple piece of code:.
h = eval[input["Enter diamond's height: "]].
for x in range[h]:.
print[" " * [h - x], "*" * [2*x + 1]].
for x in range[h - 2, -1, -1]:.
print[" " * [h - x], "*" * [2*x + 1]].

Chủ Đề