Answer:
def leap_year(y):
if y % 4 == 0:
return 1
else:
return 0
def number_of_days(m,y):
if m == 2:
return 28 + leap_year(y)
elif m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m ==10 or m == 12:
return 31
elif m == 4 or m == 6 or m == 9 or m == 11:
return 30
def days(m,d):
if m == 1:
return 0 + d
if m == 2:
return 31 + d
if m == 3:
return 59 + d
if m == 4:
return 90 + d
if m == 5:
return 120 + d
if m == 6:
return 151 + d
if m == 7:
return 181 + d
if m == 8:
return 212 + d
if m == 9:
return 243 + d
if m == 10:
return 273 + d
if m == 11:
return 304 + d
if m == 12:
return 334 + d
def days_left(d,m,y):
if days(m,d) <= 60:
return 365 - days(m,d) + leap_year(y)
else:
return 365 - days(m,d)
print("Please enter a date")
day=int(input("Day: "))
month=int(input("Month: "))
year=int(input("Year: "))
choice=int(input("Menu:\n1) Calculate the number of days in the given month.\n2) Calculate the number of days left in the given year.\n"))
if choice == 1:
print(number_of_days(month, year))
if choice == 2:
print(days_left(day,month,year))
Explanation:
Hoped this helped
The program is an illustration of functions.
Functions are groups of code segments that are executed when called or evoked
The calendar programThe calendar program in Python, where comments are used to explain each line is as follows:
#This checks for leap year
def leap_year(y):
if y % 4 == 0:
return 1
else:
return 0
#This returns the number of days in the month
def number_of_days(m,y):
if m == 2:
return 28 + leap_year(y)
elif m == 1 or m == 3 or m == 5 or m == 7 or m == 8 or m ==10 or m == 12:
return 31
elif m == 4 or m == 6 or m == 9 or m == 11:
return 30
#This returns the number of days left in the month
def days(m,d):
dayList = [0,31,59,90,120,151,181,212,243,273,304,334]
return dayList[m-1] + d
#This returns the number of days left in the year
def days_left(d,m,y):
if days(m,d) <= 60:
return 365 - days(m,d) + leap_year(y)
else:
return 365 - days(m,d)
#The main begins here
#This next three lines gets input for date
day=int(input("Day: "))
month=int(input("Month: "))
year=int(input("Year: "))
#This gets the choice from the user
menu=int(input("Press 1 to calculate the number of days in the given month.\nPress 2 to calculate the number of days left in the given year.\nChoice: "))
#This prints the number of days in the month
if menu == 1:
print(number_of_days(month, year))
#This prints the number of days left in the year
elif menu == 2:
print(days_left(day,month,year))
Read more about Python functions at:
https://brainly.com/question/14284563
True or false: Machine learning lets computers
learn how to do things they weren't
specifically programmed to do.
Answer:
True
Explanation:
what is
Force (N) = Mass (kg) x acceleration (m/s)
If a 80-kg swimmer pushes off a pool wall with a force of 225 N, at what rate with the swimmer
accelerate forward?
If you came across an article that discussed the benefits of studying the night before a test rather than the morning of, what could you do to form your own opinion about such information? A. Do your own research including reading articles related to the same topic. B. Ask a trusted family member their opinion after they read the article. C. Check different social media accounts for articles on sleep studies. D. Read another article on this topic written by the same journalist.
Answer:
A. Do your own research including reading articles related to the same topic.
Explanation:
To confirm online information that is not made by reputable experts, professionals, journals, or websites, it is always recommended to cross-check such information carefully. To do that is to make research on the same topic and confirm if the actual information is the same.
Hence, in this case, the correct answer is "Do your own research including reading articles related to the same topic."
Identify one audience for The Sun Website
Answer:
69
Explanation:
Someone please tell me what lambda does! in python!! I need help
Answer:Lambda Technologies is the he is the group name encompassing a Premier materials research laboratory with an engineering and production enterprise dedicated to the development and optimization of of surface treatments our company has been selling materials for over four decades with over 150 years of combined experience in more than 20,000 research programs we are proud of our corporate legacy in record or around standing performance in meeting or customers needs room training all excellence groundbreaking innovation and committed hard-working employees we are able to provide more than just data we provide complete service enhancement solutions are resources that can include all of our technical papers he studies defraction notes and downloads we are a well known source of research in education materials on the understanding measurement and controls of residual stress
Explanation:
I really need help with this question, I can’t fail this please :) tysm
Answer:
i think its the third one, i hope this helps
Explanation:
Can someone help me figure out why my else statment is not working?
----------------------------------------------------------------------------------------------------------------------------
print("\tBank of The Funny Money Bunny Farm\n")
print("Client\t\tDeposits\tWithdrawals\tBalance\t\tNotes:")
print("__________________________________________________________________________________________________________________________")
names = ['Judith', 'Jimmie', 'Johnny', 'Joseph', 'Jeffry', 'Buddie', 'Charlie', 'Maxine', 'Jannis', 'Bodine']
deposists = [255.23, 525.55, 323.21, 651.48, 507.11, 101.11, 253.36, 323.22, 611.45, 252.91]
withdrawals = [255.76, 128.65, 156.22, 175.33, 390.12, 255.41, 128.22, 156.23, 728.98, 251.43]
balance = []
notes = []
for i in range(len(names)):
balance.appened(deposits[i] - withdrawals[i])
if(balance < 0):
print((names[i] + ", you are overdrawn. Your account balance is " + "$%.2f"%(balance[i]))
else:
print("" + names[i] + "\t\t" + "%.2f"%(deposits[i]) + "\t\t" + "%.2f"%(withdrawals[i]) + "\t\t" + "%.2f"%(balance[i]) + "\t\t" + notes[i])
print("__________________________________________________________________________________________________________________________")
print("\© Copyright 2021 Funny Bunny Money Productions")
#Main
print("\tBank of The Funny Money Bunny Farm\n")
account = int(input("How many new accounts are needed: "))
for i in range(account):
input("Enter the name of the client: ")
input("Enter the deposist of the client: ")
input("Enter the withdraral of the client: ")
Answer:
below is a version of your code that runs.
I'm not sure if it does what you expect it to do.
Which steps should you follow to show the Developer tab after clicking Options in the File tab?
Click Customize Ribbon, and check next to Developer in the Main Tabs area.
Click the Developer tab, click Switch View, and click OK in the Main Tabs area.
Click Open, and add a check mark next to Developer in the Customize area.
Click the View tab, add a check mark next to Developer, and click OK.
Answer:
A Click Customize Ribbon, and check next to Developer in the Main Tabs area.
Explanation:
Answer:
c
Explanation:
Stacy plans to print her contacts and would like to choose an option that will print select information for each contact in a business card format. Which option should she choose?
Answer: card style
Explanation:
From the question, we are provided with the information that Stacy plans to print her contacts and the option that she would like to choose is an option that will print select information for each contact in a business card format.
Based on the above information that is given, the option that she should choose is the card style.
Why is it a good practice to use functions in programming? Select the best answer.
A.It is faster to run the code using functions.
B.Functions allow us to reuse common code.
C.All of these are correct.
D.It is easier to debug the code using functions.
Answer:
C. All of these are correct answer from the options for the question that u have given...
The good practice to use functions in programming is all of these are correct. The correct option is C.
What are functions in programming?The repetitious codes are removed by breaking a program down into functions, which not only reduces the size of the program but also improves its effectiveness. If there were repetitive codes, we would need to alter the program from several locations rather than just one.
As a result, organizing programs into functions aid in good administration and shortens programs by removing repeated code. A functional programming language is a particular kind of language that allows for the creation and application of pure mathematical functions, along with the use of conditional expressions and recursion to carry out various computations.
Therefore, the correct option is C. All of these are correct.
To learn more about functions in programming, refer to the link:
https://brainly.com/question/24297344
#SPJ6
Write a program code to accept the names of 3 users and generate a user name as shown in the example. Accept the name of 3 user in the format – Firstname Last name (eg. Anan Gupta). Select the first 3 characters from the first name, add # and then add last 3 characters of the last name. Display the newly generated user name along with the names that were input.
Answer:
Explanation:
The following code is written in Python and is a function that loops three times asking for the last name and first name. Then it uses this information to create a username. Finally, each of the names and usernames is printed on the screen.
def userName():
for x in range(3):
last_name = input("What is your last name: ")
first_name = input("What is your first name: ")
username = first_name[:3] + "#" + last_name[-3:]
print(last_name + ", " + first_name)
print(username)
how do you do the ask tutor thing on the computer?
Answer:
what do you mean
Explanation:
A beam of light travels in air and then passes through a piece of glass at an angle of 45 degrees to the normal. As the light passes from the air into the piece of glass, the light ray is bent, what is the angle of refraction measured from the normal?
Answer:
The angle of refraction measured from the normal is approximately 28.13°
Explanation:
The angle of refraction is the angle made by the refracted ray and the normal line drawn at the point where the ray passes through the interface of the two mediums
According to Snell's law, we have;
[tex]_1 n_2 = \dfrac{n_1}{n_2} = \dfrac{sin \, \theta _2}{sin \, \theta _1}[/tex]
n₁·sin (θ₁) = n₂·sin(θ₂)
Where;
₁n₂ = The refractive index of air to glass = 1.5
n₁ = The refractive index of air = 1
n₂ = The refractive index of glass ≈ 1.5
θ₁ = The angle of incidence = 45°
θ₂ = The angle of refraction measured from the normal
Therefore, we have;
1/1.5 = sin(θ₂)/sin(45°)
sin(θ₂) = sin(45°)/1.5 = (√2)/2/(3/2) = (√2)/3
∴ θ₂ = arcsin((√2)/3) ≈ 28.13°
The angle of refraction measured from the normal = θ₂ ≈ 28.13°.
Which of the following is NOT an acceptable way to create a color?
A) O "cyan"
B) O "#ff2341"
C) blue
D) "RGB (0, 15, 234)"
The option that is not an acceptable way to create a color is blue.
How can I create a color?There are a lot of ways to create some unique color such as the additions of colors together. An example is the addition of purple, orange, and green together.
Note that blue on its own cannot create another color and as such, The option that is not an acceptable way to create a color is blue.
Learn more about color from
https://brainly.com/question/4431200
#SPJ2
What is web
searching engine ?
Why Should You Love Your Job?
Answer:
I think you should love your job because if you get good grades in high school and collage you get to pick your job and it will be amazing for you in life!
Hope that helped :)
PLEASE ANSWER ASAP! 10 POINTS!
what three factors helped the Wright brothers achieve success in controlled sustained and powered flight?
Can someone please help me with this assignment on Edhesive. I just need the storyboard and code. thank you.
Answer:
i need points im so sorry
Explanation:
Write a program to convert centigrade to Kelvin. It should display value in centigrade and then the value in Kelvin just as you displayed squares in the previous question. The range to be followed for this conversion is from 50-100 degree celsius.
So, it should look like this:
1. Centrigrade: 50 --> Kelvin: 323.15
2. Centrigrade: 51 --> Kelvin: 324.15
3. Centrigrade: 52 --> Kelvin: 325.15
etc.
Answer:
for degree in range(50, 101):
kelvin = degree + 273.15
print("Centrigrade: {} --> Kelvin: {}".format(degree, kelvin))
Explanation:
*The code is in Python.
Create a for loop that iterates from 50 to 100 (Note that the starting value is included, but the ending value is not included in the range method. That is why you need to write range(50, 101) to iterate from 50 to 100)
Convert the centigrade to kelvin using formula (Note that the degree variable represents the each centigrade degree from 50 to 100 and you need to add 273.15 to convert it to Kelvin)
Print the result as in requested format
why would computer programmers want to use an object to change the instructions they already created in a computer program
Answer:
bank rupt
Explanation:
no money on your card lol have a graey day dont wish for what your not willing to work for
Boolean Operators help filter information when completing a ________ ________
A. web search
B. column making
how do you activate windows on a lenovo computer?
Answer:
Go to settings
Explanation:
Go to settings, buy an activation key, and activate Windows
Help ASAP this assignment is due today!!!!
Which are the following 4 things something must be able to do in order to be a computer? *
Answer:
There are four main equipment functions of a computer system: Input, Processing, Storage and Output.
Explanation:
True or False? Security code is almost always open source!
True
False
Answer:
its true
Step-by-step explanation:
Security code is almost always open source is a false statement. Check more about Security code below.
What is security code?The Security code is known to be the number that is known to be found in the front or back of any credit cards. It is made just for security use.
Conclusively, Security code is almost always open source as one cannot get it except one is told about it. Therefore, it is not an open source.
Learn more about Security code from
https://brainly.com/question/26260220
Read the code snippet below and determine which markup language it is:
Sound Card
Creative Labs
Sound Blaster Live
80.00
The code is an example of the (Blank) markup language.
Answer:
Sound Card
Explanation:
Write a C++ program to add two integers. Make a function add() to add integers and display sum in main() function.
Answer:
In C++:
#include <iostream>
using namespace std;
int add(int a, int b){
int c = a + b;
return c;
}
int main(){
int a, b;
cout<<"Enter two numbers: ";
cin>>a;
cin>>b;
cout<<add(a,b);
return 0;
}
Explanation:
The add() function begins here
int add(int a, int b){
This adds the two integers
int c = a + b;
This returns the sum of the two integers
return c;
}
The main begins here
int main(){
This declares two numbers
int a, b;
This prompts user for two numbers
cout<<"Enter two numbers: ";
The next two lines gets the two numbers
cin>>a;
cin>>b;
This gets the sum of the two numbers from the add() function. The sum is also printed
cout<<add(a,b);
return 0;
}
How is a digital representation of analog data a form of abstraction? Why is the quality of the photo, music, etc better when more samples are taken? Music is an example of analog data. What other examples of analog data can you think of?
Answer:
1. This is because non-essential parts of the analog data is cut of so as to represent the analog data digitally.
2. This is because it mirrors closely to the original analog material.
3. i. Temperature ii. Speed ii. Distance iv. Electric current
Explanation:
1. How is a digital representation of analog data a form of abstraction?
Digital representation of analog data is a form of abstraction because, since abstraction, which is the removal of non-essential parts of a material so as to reduce complexity, also non-essential parts of the analog data is cut of so as to represent the analog data digitally.
2.Why is the quality of the photo, music, etc better when more samples are taken?
The quality of these items is better because, as more samples are taken, it reduces the error in the sampling and the item(photo, music etc) mirrors closely to the original analog material.
3. What other examples of analog data can you think of?
i. Temperature ii. Speed ii. Distance iv. Electric current
What are some potential challenges that society will face given the digital revolution? You may want to think particularly of the news industry. Discuss how these challenges could impact young people such as yourself.
Answer:
Some said that technology causes more problems than it solves. ... Others said humans' uses and abuses of digital technologies are causing ... Highly technological societies have to be iterative if they hope to ... where we believe we can tell honestly delivered information from fake news and disinformation.
hope this helps...
Explanation: