Using the computational knowledge in python it is possible to write a code that Write a recursive function called digit_count()
<h3>What is a function in Python?</h3>
In Python, a function is a sequence of commands that performs some task and that has a name. Its main purpose is to help us organize programs into chunks that correspond to how we envision a solution to the problem.
<h3>Writting the code in python:</h3>
<em>def countDigits(n):</em>
<em> if n< 10:</em>
<em> return 1</em>
<em> else:</em>
<em> return 1 + countDigits(n / 10)</em>
See more about python at brainly.com/question/13437928
#SPJ1
Answer:
Explanation:
Using Python programming language
Explanation:
1. I defined a function add and passed in two parameters (a,b).
2. In the block of the function, I added the two numbers and printed the result.
3. I decided to use a function so that the program is re-usable and can accept various inputs.
Find the code below. (# are used for comments)
#Addition of numbers
def add(a,b):
print(a+b)
#Test Cases
add(2,4.5) #Result=6.5
add(10,290) #Result=300
add(2.567,4.58) #Result=7.147
Answer:
#here is code in python.
#read number of shares
num_share = int(input("Enter number of shares:"))
#read purchase price
buy_p = float(input("Enter purchase price:"))
#read sell price
sell_p = float(input("Enter sale price:"))
#total buying cost
buy_cost=buy_p*1.03*num_share
#total selling cost
sell_cost=sell_p*0.97*num_share
#if net profit
if(sell_cost>buy_cost):
print("After the transaction, you made " +str(sell_cost-buy_cost)+ " dollars.")
#if net loss
else:
print("After the transaction, you lost " +str(buy_cost-sell_cost)+ " dollars.")
Explanation:
Read the total number of shares from user.Then read buying price of a share and selling price of a share.Then calculate total buying cost including commission.Calculate total selling cost excluding the commission.If total buying cost is greater than total selling cost the print the profit else print the loss in the transaction.
Output:
Enter number of shares:10
Enter purchase price:10
Enter sale price:10
After the transaction, you lost 6.0 dollars.
Answer:
I have no clue. I wish I could help though.
Explanation:
Sorry
The PCL express version 4.0 can provide up to 32 gigabytes with 16 lanes for data.
<h3>What is PCI Express?</h3>
PCI Express, often known as PCIe or PCI-e, is a high-speed serial computer expansion bus standard that was developed to replace the previous PCI, PCI-X, and AGP bus standards.
Thus, it is correct to state that the PCL express version 4.0 can provide up to 32 gigabytes with 16 lanes for data.
Learn more about PCI Express:
brainly.com/question/13898111
#SPJ1