Answer:
Math & Trig
Explanation:
INT is Math & Trig function that returns the integer part of the given number, rounds down to the nearest integer.
For example,
INT(3.1428) will give us 3
INT(-5.88) will give us -6
Answer:
192.168.30.0/24 is the network IP address and 192.168.30.255/24 is the IP broadcast address.
Explanation:
The first IP (192.168.30.0/24) address of your subnet is the network address, the last IP (192.168.30.255/24) address of your subnet is your broadcast address and the available usable IP addresses in your subnet are subnet size -2, because network address and broadcast address cannot be allocated to a system.
Answer:
- import datetime
-
- def get_year_of_birth():
- age = int(input("Enter your age: "))
- current_year = datetime.datetime.now().year
- year_of_birth = current_year - age
- return year_of_birth
-
- print(get_year_of_birth())
Explanation:
Firstly, we import datetime module as we need it to get the current year (Line 1).
Next, create a function named it as get_year_of_birth (Line 3). Prompt user to input age and assign it to a variable (Line 4). Next, we use now() method from datetime module to get the current date and time and extract the year component (Line 5). At last, calculate the year of birth by subtracting the current_year with age and return it as output (Line 6-7).