Ask Question

Exercises 2.12 Write Python expressions corresponding to these statements: (a) The sum of the first seven positive integers (b) The average age of Sara (age 65), Fatima (57), and Mark (age 45) (c) 2 to the 20th power (d) The number of times 61 goes into 4356 (e) The remainder when 4365 is divided by 61

+4
Answers (1)
  1. 24 December, 09:44
    0
    The python expressions are given in the explanation section

    The comments specifies each sub-question

    Explanation:

    #The sum of the first seven positive integers

    sum = 0

    for i in range (1,8):

    sum + =i

    print (sum)

    #The average age of Sara (age 65), Fatima (57), and Mark (age 45)

    Sara_Age = 65

    Fatimah_Age = 57

    Mark_Age = 45

    Average_Age = (Sara_Age+Fatimah_Age+Mark_Age) / 3

    print (Average_Age)

    # 2 to the 20th power

    num = pow (2,20)

    print (num)

    #The number of times 61 goes into 4356

    num_times = 4356/61

    print (num_times)

    #The remainder when 4365 is divided by 61

    remainder = 4365%61

    print (remainder)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Exercises 2.12 Write Python expressions corresponding to these statements: (a) The sum of the first seven positive integers (b) The average ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers