Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

im doing an assignment and im stuck
this is the code i wrote
def number_of_days(m):
if (m == 1,3,5,7,8,9,11):
woh = 31
elif (m == 2):
woh = 28
elif (m == 4,6,10,12):
woh = 30
print (woh)
print (29)


def days_left(d,m,y):
if (d > 0):
print ('135')
def leap_year(d,m,y):
if (d > 0):
print ('1')

day = int(input('Enter the day.'))
month = int(input('Enter the month.'))
year = int(input('Enter the year.'))
menu = int(input('Day in month or left in year? (1,2)'))
if (menu == 1):
monthdays = number_of_days(month)
print (monthdays)
elif (menu == 2):
dayleft = days_left(day,month,year)
print (dayleft)

but its not working
Assignment 3: Chatbot
Using the string methods from Unit 7, write a program that asks the user to enter two words, change them to upper case, then prints them in alphabetical order
We are well into the 21st century and school children are taught dynamic programming in class 4. The IOI training camp has degenerated into an endless sequence of tests, with negative mamp, each student is evaluated based on the sum of the best contiguous segment (i.e., no gaps) of marks in the overall sequence of tests.

Students, however, have not changed much over the years and they have asked for some relaxation in the evaluation procedure. As a concession, the camp coordinators have agreed that students are allowed to drop upto a certain number of tests when calculating their best segment.

For instance, suppose that Lavanya is a student at the training camp and there have been ten tests, in which her marks are as follows.

Test 1 2 3 4 5 6 7 8 9 10
Marks 6 -5 3 -7 6 -1 10 -8 -8 8
Write a for loop to print the numbers from 20 to 30, inclusive (this means it should include both the 20 and 30). The output should all be written out on the same line.
Create a calendar program that allows the user to enter a day, month, and year in three separate variables as shown below.

Please enter a date
Day:
Month:
Year:
Then, ask the user to select from a menu of choices using this formatting:

Menu:
1) Calculate the number of days in the given month.
2) Calculate the number of days left in the given year.
The program must include the following functions:

leap_year: Takes the year as a parameter and returns 1 if a year is a leap year (Links to an external site.) and 0 if it is not. This information will only be used by other functions.
number_of_days: This subprogram will accept two parameters in the following order: month and year. It will return how many days are in the given month (Links to an external site.).
days_left:
In this assignment, you will write a program that will process data in the jokes.txt (Links to an external site.) and answers.txt (Links to an external site.) files. Set up your program so that it will do the following tasks:

Displays the number of jokes in jokes.txt
Asks the user for the number of a joke
Displays the joke
Displays the requested joke
Displays the requested answer
Use the answers_filepath and jokes_filepath variables to open the files and solve this problem.
https://py3.codeskulptor.org/#user305_iNNeupjp2d_0.py

Could you look through this code from Edhesive Assignment 9 and fix it? I don't understand what's wrong.
import os

# This program has read/write access to the WORKSPACE directory
filepath = os.path.join(os.environ['PATH'],"NewYorkTemps.txt")

# The testing system will let this program know how many lines to expect
num_of_lines = int(input())

# Copy input into the file. Do not modify!
with open(filepath,"w+") as file:
for _ in range(num_of_lines):
file.write(input()+"\n")

# Write your program below
In this assignment, you will use all of the graphics commands you have learned to create an animated scene. Your program should have a clear theme and tell a story. You may pick any school-appropriate theme that you like.

The program must include a minimum of:

5 circles
5 polygons
5 line commands
2 for loops
1 global variable
LATEST TUTORIALS
APPROVED BY CLIENTS