Answer:
def rec_dig_sum( num ):
num_list = [ digit for digit in str(num)]
total = 0
for x in num_list:
total += x
return total
def dict_of_rec_dig_sums(low, high):
mydict = dict()
for number in the range(low, high+1):
mydict[rec_dig_sum(number)] = number
return mydict
Explanation:
The python program defines two functions, "rec_dig_sum" and "dict_of_rec_dig_sums". The former accepts a number and returns the sum of the digits of the number while the latter accepts a low and high number range.
The program returns a dictionary with the recursive sum as the keys and the number count as the values.
def pig_latin(word):
if word[0].lower() in 'aeiou':
word = word + 'way'
else:
t=''
for x in range(len(word)):
if word[x].lower() in 'aeiou':
break
if word[x].lower() == 'y' and x>0:
break
else:
t+=word[x].lower()
if word[0].isupper():
word = word[len(t):]+word[:len(t)].lower()+'ay'
word = word.title()
else:
word = word[len(t):]+word[:len(t)].lower()+'ay'
return word
word = 'test'
pl = pig_latin(word)
print(pl)
I wrote my code in python 3.8. I hope this helps.
Answer:
by building on line presence
Explanation:
If you put yourself out there in multiple social sites you will build a following
Hello!
A stereotype is a generalized belief about a particular category of people.