Note that the output was not Hatter, as you might have guessed. This is because in Python, indexing begins with 0, not 1. This property is called 0-based numbering, and it's shared by many programming languages.
Phyton 3. Списки. Массивы.
You can easily change existing list items by reassigning them. Try running the following:
tea_party[1] = 'Cheshire Cat'
print(tea_party)
This code should output the list with "Hatter" replaced by "Cheshire Cat":
{
if (tnum < tden)
{
temp = tnum;
tnum = tden;
tden = temp;
}
tnum = tnum - tden;
}
gcd = tden; //вычисляем наибольший общий делитель
numerator = numerator / gcd; //делим числитель и знаменатель на
НОД, получаем сокращенную дробь
denominator = denominator / gcd;
begin
writeln('Дано уравнение вида ax^2+bx+c=0');
Writeln ('Укажи переменную "a"');
readln(a);
Writeln ('Укажи переменную "b"');
readln(b);
Writeln ('Укажи переменную "c"');
readln(c);
if a = 0
then writeln('Не квадратное уравнение!')
else begin
d:= sqr(b)-4*a*c;
if d < 0 then writeln('Нет корней')
else begin
x1:= (-b+sqrt(d))/2*a;
x2:= (-b-sqrt(d))/2*a;
writeln ('X1 =',x1,' X2 =',x2);
end;
end;
end.