The function to test for divisibilty by 3 will accept an input integers and divide it by three to check if its divisible by 3.
The function to test for divisiblity by 3 is as follows:
integer = input("input the integer to check if it's divisible by 3: ")
def reduce(integer):
list1 = []
sum1 = 0
for i in str(integer):
list1 += i
results = list(map(int, list1))
for x in results:
sum1 += x
if sum1 < 20 and sum1%3==0:
return "The integer is divisible by 3"
elif sum1 < 20 and sum1%3 != 0:
return "The integer is not divisible by 3"
else:
while sum1 >= 20:
z = sum(list(map(int, list(str(sum1)))))
if z%3==0:
return "The integer is divisible by 3"
else:
return "The integer is not divisible by 3"
print(reduce(integer))
<h3>Code explanation</h3>
- The integer variable stores the users input.
- We define a function called "reduce". The reduce function accepts the interger variable as a parameter.
- The code loop through the integer and check if it is divisible by 3.
- If the sum of the integer number is greater or equals to 20, we divide the resulting sum by 3 .
- If the integer is divisible by 3, we return "it is divisble by 3" and if it is not dividible by 3, it will return "it is not divisble by 3".
learn more on python here: brainly.com/question/13437928
A LAN (local area network) is a group of computers and network devices connected together, usually within the same building. By definition, the connections must be high speed and relatively inexpensive (e.g., token ringor Ethernet). Most Indiana University Bloomington departments are on LANs.
A LAN connection is a high-speed connection to a LAN. On the IUB campus, most connections are either Ethernet (10 Mbps) or Fast Ethernet (100 Mbps), and a few locations have Gigabit Ethernet (1000 Mbps) connections.
A MAN (metropolitan area network) is a larger network that usually spans several buildings in the same city or town. The IUB network is an example of a MAN.
A WAN (wide area network), in comparison to a MAN, is not restricted to a geographical location, although it might be confined within the bounds of a state or country. A WAN connects several LANs, and may be limited to an enterprise (a corporation or an organization) or accessible to the public. The technology is high speed and relatively expensive. The Internet is an example of a worldwide public WAN.
Answer:
Line number 7.
Explanation:
If I am not wrong, the first line in this question would be #include<iostream>. That is used to add input and output stream of the program.
if we look at the line 1,2,3. These are just the packages/definition required to start a program.
Line 4 starts the main program and line 5 starts the block of main program. The block ends at line 10. So ,there should be no error in line 4,5 and 10.
If we look at line 6, we can see a constant integer(const int MY_VAL = 77) definition and initialization.
The main problem is, you cannot assign a value to a constant (MY_VAL) except during initializing stage.
Therefore, the line 6 is also true. However, this program is further trying to assign a value to constant at line 7. Therefore, the compiler will throw error (ERROR; assigning to const value).
There can be several reasons why the user is not able to delete a file on the NTFS Volume or disk partition of the computer. Possible scenarios are as follows.
1. The user does not have sufficient permission to perform the task as the file itself may not be owned with the user. The best way is to make sure the user is an administrator.
2. The file is corrupted which prevents to properly access, running a chkdsk will help to validate with this.
3. Another common scenario is that the file is actually currently in use.