Answer:
def countdown(n):
if n <= 0:
print('Blastoff!')
else:
print(n)
countdown(n-1)
def countup(n):
if n >= 0:
print('Blastoff!')
else:
print(n)
countup(n+1)
number = int(input("Enter a number: "))
if number >= 0:
countdown(number)
elif number < 0:
countup(number)
<u>Outputs:</u>
Enter a number: 3
3
2
1
Blastoff!
Enter a number: -3
-3
-2
-1
Blastoff!
Enter a number: 0
Blastoff!
For the input of zero, the countdown function is called.
Explanation:
Copy the countdown function
Create a function called countup that takes one parameter, n. The function counts up from n to 0. It will print the numbers from n to -1 and when it reaches 0, it will print "Blastoff!".
Ask the user to enter a number
Check if the number is greater than or equal to 0. If it is, call the countdown function. Otherwise, call the countup function.
Answer:
def printRange(start, stop, steps = 1):
list1 = []
if steps > start or stop:
print("Steps is larger than start and stop value")
return None
if int(start) < int(stop):
while start < stop:
start = start + int(steps)
list1.append(start)
print(list1)
elif start > stop:
while start > stop:
stop = stop + int(steps)
list1.append(stop)
print(list1)
elif start == stop:
print(start)
else:
print("Values are not integers.")
for easier viewing:
https://www.codepile.net/pile/e95verLk
If you need help understanding comment below.
☆ <u>Since, the computer accepts raw data as input and converts into information by means of data processing, it is called information processing machine (IPM).</u>
HOPE IT HELPS ❣️
Answer:
The internet is considered as Wide Area Network (WAN).
Answer :
These sort of attacks are known are Injected IFrame Attacks. The Injected IFrame Attacks are a common Cross Site Scripting or XCC attack that contains multiple or single iFrame tags implemented within a page which is not visible to user. User unintentionally enters his information which is posted to hacker’s server and information’s gets hacked.