Answer:
5 5/7
Step-by-step explanation:
Answer:
{0,1,3,4}
Step-by-step explanation:
Given, total no of slices=8.
Total no of friends=4.
also each friend didnt ate more than the other three.
let a,b,c,d be no of slices ate by the friends 1,2,3,4 respectively.
given sum of a+b+c+d=8.
now applying the second condition

so each of a,b,c,d must be less than or equal to 4.
which means 5 values are possible{0,1,2,3,4}.from this set you have to select 4 values such that their sum is 8.hence, those values are {0,1,3,4}.
Answer:
def validateID(this_id):
is_valid = 0
checksum = 0
n = int(this_id)
count=1
while(n!=0):
d=int(n%10)
if(count%2==0):
d=d*2
if(d<10):
checksum=checksum+d
else:
while(d!=0):
x = int(d%10)
checksum = checksum + x
d=int(d/10)
else:
checksum=checksum+d
count=count+1
n=int(n/10)
if(checksum%10==0):
is_valid=1
return is_valid, checksum
def main():
test_id = "176248"
is_valid, checksum = validateID(test_id)
if(is_valid==1):
print(test_id+" is valid and checksum is "+str(checksum))
else:
print(test_id+" is not valid and checksum is "+str(checksum))
test_id = "79927398713"
is_valid, checksum = validateID(test_id)
if(is_valid==1):
print(test_id+" is valid and checksum is "+str(checksum))
else:
print(test_id+" is not valid and checksum is "+str(checksum))
test_id = "6080320539447211"
is_valid, checksum = validateID(test_id)
if(is_valid==1):
print(test_id+" is valid and checksum is "+str(checksum))
else:
print(test_id+" is not valid and checksum is "+str(checksum))
return
if __name__ == '__main__':
main()
Answer:
25 and 17
Step-by-step explanation:
25+17=42
25-17=8
Um what do you mean if your asking it as a fraction then 1/4