def create_global_variable(var_name, var_value):
if var_name in globals():
print('Such variable already exists')
return
globals()[var_name] = var_value
var_name = input('Enter variable name: ')
var_value = input('Enter variable value: ')
create_global_variable(var_name, var_value)
print(f'You have created variable {var_name}={eval(var_name)}')
#include <iostream>
void printPolynom(double* coefs, int degree, std::ostream& os)
{
static const char VAR = 'x';
bool first = true;
for (int i = degree; i >= 0; --i) {
double coef = *coefs;
coefs++;
if (!first && coef > 0.0) {
os << "+";
}
first = false;
os << coef;
for (int j = 0; j < i; ++j)
os << '*' << VAR;
}
}
int main()
{
const int degree = 3;
double coefs[degree + 1] = { 9, 3, 12, -1 };
printPolynom(coefs, degree, std::cout);
std::cout << "\nDone";
return 0;
}
>>> html.info()
<http.client.HTTPMessage object at 0x10aef1518>
>>> html.info().items()
>>> data = html.read()
>>> import gzip
>>> gzip.decompress(data)
>>> import requests
>>> response = requests.get("https://wallpaperscraft.ru")
>>> response.content
bot.t()
longpoll.t(bot) # bot это и будет self в методе t