Python
11
Вклад в тег
def midel(numbers):
numbers = [int(number) for number in numbers]
return sum(numbers) / len(numbers)
numbers = input("Введите цифры через пробел: ")
numbers = numbers.split(" ")
result = midel(numbers)
print(f"Результат: {result}")
Введите цифры через пробел: 2 2 2 2
Результат: 2.0
import datetime
total_time = datetime.timedelta()
lst = ["00:33:33", "00:23:34", "01:32:21"]
for time in lst:
hours, minutes, seconds = time.split(":")
hours, minutes, seconds = int(hours), int(minutes), int(seconds)
total_time += datetime.timedelta(hours=hours, minutes=minutes, seconds=seconds)
print(total_time)
@bot.command()
async def grole(ctx):
import io
username = ctx.author
channel = bot.get_channel(id=111111111111111111)
for attach in ctx.message.attachments:
imgn = attach.filename
img = io.BytesIO(await attach.read())
await channel.send(file = discord.File(img, imgn))