Answer:
# -*- coding: utf-8 -*-
# Get N from the command line
import sys
N = int(sys.argv[1])
if N > 0: #N is positive
positve = list(range(N,0,-1))
print(positve)
elif N < 0: #N is negative
negative = list(range(N,0,1))
print(negative)
else:
print("Invalid in input")
Explanation:
First, you need to identify if the number entered is positive, negative or none of them, for that we use one if, one elif and one else statement:
- If the number entered (N) is greater than zero (is positive) we print a list in the range N to 0 in steps of minus one, the zero is not printed because the function range by default omits the last value
- If the previous statement was False and the number entered is smaller than zero (is negative) we print a list in the range N to 0 in steps of one, the zero is not printed because the function range by default omits the last value
- Finally, if the two previous events were false print invalid input
Answer:
When the circuit switch is off, no electricity will flow and then the circuit is called an open circuit. Electricity will not flow in open circuit.
Answer:
a. $79,122.50
b. 314. 84 miles.
c. 700 ways.
Explanation:
a. Compound interest = A = P (1 + r/n)nt ;
where P = 7500 (principal amount)
r = 15% (interest rate)
t = 16 (no of years)
n = 4 (no of times compounded annually.)
and finally A is the Amount (present value after 16 years)
Upon calculation A = $79,122.50.
b. Answer: 314. 84 miles.
Explanation:
Given data. 160 miles / 7.75 liters of gasoline
Therefore 1 liter of gasoline = 160/7.75 = 20.645 miles/ liter.
15.25 liters of gasoline = 20.645 * 15.25 = 314.84 miles.
c. Answer: 700 ways.
Explanation:
This is an application of generalized principle of counting.
4 Americans can be choosen from 7 Americans = 7C4 = 35
3 Russians can be choosen from 6 Russians = 6C3 = 20.
Total number of ways = (7C4)* (6C3) = 35 * 20 = 700 ways.
Answer:
I'm going to make a list of everything you need to consider for the supervision and design of the bridge.
1. the materials with which you are going to build it.
2. the length of the bridge.
3. The dynamic and static load to which the bridge will be subjected.
4. How corrosive is the environment where it will be built.
5.wind forces
6. The force due to possible earthquakes.
7. If it is going to be built in an environment where snow falls.
8. The bridge is unique,so the shape has a geometry that resists loads?.
9. bridge costs.
10. Personal and necessary machines.
11. how much the river grows