1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vekshin1
2 years ago
10

In this exercise, you'll raise a manual exception when a condition is not met in a particular function. In particular, we'll be

converting birth year to age. Specifications One a new cell in your notebook, type the following function >>> import datetime >>> class InvalidAgeError(Exception): pass >>> def get_age(birthyear): age = datetime.datetime.now().year - birthyear return age Add a check that tests whether or not the person has a valid (0 or greater) If the age is invalid, raise an InvalidAgeError Expected Output >>> get_age(2099) Traceback (most recent call last): File "", line 1, in __main__.InvalidAgeError
Computers and Technology
1 answer:
Shtirlitz [24]2 years ago
8 0
Dhjejekewk that’s a lot
You might be interested in
import java.io\.\*; import java.nio.file\.\*; public class TestFileReader { public static void main(String[] args) { Path p = Pa
Charra [1.4K]

Answer:

The delimiter use is "::".

Explanation:

The Java inbuilt String.split( ) function is use to split a String into an array of String.

The split( ) takes delimiter as arguments/parameter which determines at which point the string is to be broken down into different part/token.

From the above code snippet;

Each line in the file a.txt that is not null is splitted using the statement below:

String[ ] v = line.split("::");

The line is splitted using "::" as delimiter and the resulting array is then assigned to the variable 'v'.

For instance, a line in the file could take the form:

John::Smith::Music

When it is splitted,

String lname = John;

because lname make reference to index 0 of the array.

String fname = Smith;

because fname make reference to index 1 of the array.

String dept = Music;

and dept make reference to index 2 of the array.

6 0
3 years ago
Type the correct answer in the box. Spell all words correctly.
erica [24]

Answer:

Router

Explanation:

Routers have something called a WAN link, which can be used to connect 2 local area networks

7 0
3 years ago
Describe one way that cells use water
antiseptic1488 [7]
In chemical reactions, as a carrier of materials or keeping the temperature of cells from quickly changing.
8 0
3 years ago
The term unauthorized access is a synonym for hacking. <br><br> a. True <br><br> b. False
natita [175]
The answer is True. Hacking is synonymous with unauthorized access most especially when it is intentional. Unauthorized access is defined as illegally gaining access to a file on a computer. It is the same as accessing a network or system without the permission of the owner.
8 0
3 years ago
Write a program that asks the user to type 5 integers
AnnZ [28]

import Java.util*

public class Average{
public static void main(String [] args){

int sum = 0;
int numbers = 0;

for(int i = 0; i < 5; i++){
Scanner sc = new Scanner(System.in);
System.out.println(“Please enter your integers: “);
numbers = sc.nextInt();

sum += numbers;
}
System.out.println(“The average is: “ + sum/5)”
}
}
5 0
2 years ago
Other questions:
  • I am trying to figure out why I keep having the errors on the right side.
    5·1 answer
  • What shows on the web, what is behind the web (source code) and what is placed on the server (database) , is known as web source
    13·1 answer
  • Using a pin or password in addition to tpm is an example of what type of authentication?
    13·1 answer
  • Claim: Raising the minimum wage does not help most minimum wage employees Reason: Many small businesses cannot afford high minim
    14·2 answers
  • Marty uses a customized database to sort parts and track inventory. The customized database is an example of _____.
    15·1 answer
  • Write a program that converst the temperature from Celcius to Fahrenheit. The formula is: F (9/5)C+32
    12·2 answers
  • If you are logged on to Windows Live Messenger, why would you be unable to engage
    6·1 answer
  • Anyone have an answer for 4.9 lesson code practice
    9·1 answer
  • Why is malware dangerous
    15·2 answers
  • Data frames can be subset by a chosen value using ==.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!