ivan.set("Иван", 33)
class Person:
name = "Кристи"
age = 10
def __init__(self, name, age):
self.name = name
self.age = age
def set(self, name, age):
self.name = name
self.age = age
ivan = Person('Иван', 33)
telebot.apihelper.proxy = {'https':'socks5://127.0.0.1:9050'}
def calculate_score(lst):
total_score = 0
has_bonus = True
for radius in lst:
if radius >=5 and radius <=10:
total_score += mid_points
elif radius < 5:
total_score += max_points
if radius > 5:
has_bonus = False
if has_bonus:
total_score += bonus_points
return total_score
def calculate_score(lst):
total_score = 0
for radius in lst:
if radius >=5 and radius <=10:
total_score += mid_points
elif radius < 5:
total_score += max_points
if max(lst) < 5:
total_score += bonus_points
return total_score
import requests
img_url = 'http://markof.fun/im/1.png'
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36'}
r = requests.get(img_url, headers=headers)
if r.status_code == 200:
with open('temp.png', 'wb') as f:
f.write(r.content)
else:
print('Error', r.status_code)