Answer:
Written in Python:
def licenseNum(licenseYear, customID):
output = 100000 * customID + licenseYear
print("Dog license: "+str(output))
Explanation:
This line defines the function with parameters licenseYear and customID
def licenseNum(licenseYear, customID):
This calculates the output as stated in the question
output = 100000 * customID + licenseYear
This displays the output
print("Dog license: "+str(output))
To call the function, make use of: licenseNum(2014, 777)
Where 2014 and 777 can be replaced with other digits as required
In the mother board of the back door next to the restroom 5 steps left
Answer:
In Python:
low = int(input("Low: "))
high = int(input("High: "))
if low >= 1000000000 or high >=1000000000:
print("Out of range")
else:
mylist = []
for num in range(low,high+1):
flag = False
if num > 1:
for i in range(2, num):
if (num % i) == 0:
flag = True
break
if not flag:
mylist.append(num)
print(num, end = " ")
print()
print("The twin primes are: ",end="")
count = 0
for i in range(1,len(mylist)):
if mylist[i] - mylist[i-1] == 2:
print(str(mylist[i])+" & "+str(mylist[i-1]),end=", ")
count+=1
print()
print("There are "+str(count)+" twin primes")
Explanation:
See attachment for complete program where comments were used to explain each line
Answer:
num = float(input("Enter a number : "))
ab = abs(num)
sqrt = float(ab ** 0.5)
print(sqrt)
Explanation:
A book recommended from your professor is a reliable source of information.