Answer:
See the code below in python.
Explanation:
num = int(input("Enter a number: "))
if (num == 0):
print("You entered 0...")
elif (num < 0):
print("Your entered a negative number...")
else:
print("You entered a positive number...")
Regards: Your Friendly Study Co-Pilot!
Answer:
Check the explanation
Explanation:
print("************************************************************")
sentence = input("Enter a sentence : ").split()
replace_words = input("\nEnter the words that should be replaced : ").split()
special = input("\nEnter the replacing special Character : ")
result = []
for word in sentence:
if word not in replace_words:
result.append(word)
else:
result.append(special * len(word))
result = ' '.join(result)
print("\nThe Sentence with words censored is : " + result)
print("************************************************************")
Multiple answers. Attachment and practice of sending unwanted messages
Bachelor's degree would be next in line .. im taking the test as well im going with A.
Answer:
The solution code is written in Python 3
- SPY = float(input("Enter SPY Amount: "))
- QQQ = float(input("Enter QQQ Amount: "))
- EEM = float(input("Enter EEM Amount: "))
- VXX = float(input("Enter VXX Amount: "))
-
- totalAmount = SPY + QQQ + EEM + VXX
- print("Total amount invested: $" + str(totalAmount))
- print("Percentage invested for SPY: " + str(SPY / totalAmount * 100) + "%")
- print("Percentage invested for QQQ: " + str(QQQ / totalAmount * 100) + "%")
- print("Percentage invested for EEM: " + str(EEM / totalAmount * 100) + "%")
- print("Percentage invested for VXX: " + str(VXX / totalAmount * 100) + "%")
Explanation:
Firstly, let's declare four variables, SPY, QQQ, EEM and VXX and use input() function to prompt user to input the amount invested in each fund (Line 1 - 4).
Next, sum up all the funds' amount and assign the total to totalAmount variable (Line 6).
Next display the total amount invested and the percentage invested for each fund using print function (Line 7 - 11). Please note the formula to calculate the percentage of investment is
(fund / totalAmount ) * 100