camidevecchis15
10.03.2021 •
Mathematics
1
Bobby has
7.
of a kilogram of gold. He wants to share it equally between himself and 1 friend. How much
gold will each person get?
Which expression could represent this situation?
Choose 1 answer,
1 / 3
2
B
7
2
Solved
Show answers
More tips
- F Family and Home 5 Tips for Choosing Toys for Your Child...
- L Leisure and Entertainment How to Find a Phone Number by Address: The Ultimate Guide...
- P Philosophy How to Properly Create a Vision Board?...
- C Computers and Internet What is Web 2.0 and How Does it Work?...
- S Style and Beauty Is Photoepilation the Solution to Unwanted Hair Forever?...
- O Other What is a Disk Emulsifier and How Does it Work?...
- F Family and Home What does a newborn need?...
- F Family and Home Choosing the Right Car Seat for Your Child: Tips and Recommendations...
- F Food and Cooking How to Get Reconfirmation of Registration?...
- C Computers and Internet How to Get Rid of Spam in ICQ?...
Answers on questions: Mathematics
- M Mathematics Can someone help me?...
- M Mathematics Solve the equation x² =6...
- M Mathematics An object travels between two locations 18 miles apart in 2 hours. What is the average speed of the object? 2 mph 9 mph 18 mph 6 mph please help...
- H History Why did none of the 3 explore Expand there travels west toward Colorado...
Ответ:
Ответ:
def arithmetic (n, dist):
sum = 0
for num in range(1, n + 1, dist):
sum += num
print(sum)
arithmetic(10, 2)
Step-by-step explanation:
The question asked us to write a program given the positive integer n, and positive integer distance and then associate the variable sum with the sum of the elements of the arithmetic progression from 1 to n with distance.
using python the code can be written as:
def arithmetic (n, dist):
I wrote a function that accept 2 argument n the positive integer and the distance , dist.
sum = 0
The sum is equal to 0 at the beginning.
for num in range(1, n + 1, dist):
The code loop through the number in the range of 1 to the n value with a distance value.
sum += num
The looped value are then added to the sum value to get the sum.
print(sum)
The sum are printed
arithmetic(10, 2)
The function is called and filled with the required argument . In our case the positive integer n is inputted and the distance value.