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.
If you save the input as num,
this will print the input 8 times.
num = input("Enter a number: ")
print(num * 8)
If you want to do actual math calculations,
then the input needs to be a number.
num = float(input("Enter a number: "))
print(num * 8)
This doesn't account for any errors in which the user doesn't input a number, but I don't think that's what you were looking for anyway :)
An overhead projector is required to display content on transparencies. A transparency is a thin sheet of plastic in which light is reflected upon to display content.The light source emits light towards the transparency and then the image is displayed on the wall. Usually, this light source comes from below and lights upward and so the content is depicted above or overhead.
The line code will create array is G = array('f',[2.5, 3, 7.4])
<h3>What is meant by array ?</h3>
As opposed to defining distinct variables for each value, arrays are used to hold numerous values in a single variable. Set the data type (such as int) and the array name, followed by square brackets [, to construct an array.
An array is a collection of elements with the same type that are kept in nearby memory locations and may each be separately referred to using an index to a special identifier. There is no need to declare five distinct variables when declaring an array of five int values (each with its own identifier).
In the C programming language, arrays are a derived data type that may contain primitive data types like int, char, double, float, etc.
To learn more about array refer to :
brainly.com/question/28061186
#SPJ1
Explanation:
I dont have Instagram....