<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="sv">
	<id>https://wikiskola.se/index.php?action=history&amp;feed=atom&amp;title=Andragradsekvation_Python</id>
	<title>Andragradsekvation Python - Versionshistorik</title>
	<link rel="self" type="application/atom+xml" href="https://wikiskola.se/index.php?action=history&amp;feed=atom&amp;title=Andragradsekvation_Python"/>
	<link rel="alternate" type="text/html" href="https://wikiskola.se/index.php?title=Andragradsekvation_Python&amp;action=history"/>
	<updated>2026-05-05T03:22:34Z</updated>
	<subtitle>Versionshistorik för denna sida på wikin</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://wikiskola.se/index.php?title=Andragradsekvation_Python&amp;diff=50180&amp;oldid=prev</id>
		<title>Hakan: /* Python-koden */</title>
		<link rel="alternate" type="text/html" href="https://wikiskola.se/index.php?title=Andragradsekvation_Python&amp;diff=50180&amp;oldid=prev"/>
		<updated>2019-02-11T07:51:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Python-koden&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;sv&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Äldre version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Versionen från 11 februari 2019 kl. 07.51&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l23&quot;&gt;Rad 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Rad 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from math import *&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;from math import *&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;print(&quot;Programmet löser en andragradsekvation av typen ax\u00b2+&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bx&lt;/del&gt;+&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;c&lt;/del&gt;=0\n&quot;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;print(&quot;Programmet löser en andragradsekvation av typen ax\u00b2+&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;px&lt;/ins&gt;+&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;q&lt;/ins&gt;=0\n&quot;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;a = float(input(&amp;quot;a = &amp;quot;))&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;a = float(input(&amp;quot;a = &amp;quot;))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;b &lt;/del&gt;= float(input(&quot;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;b &lt;/del&gt;= &quot;))&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;p &lt;/ins&gt;= float(input(&quot;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;p &lt;/ins&gt;= &quot;))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;c &lt;/del&gt;= float(input(&quot;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;c &lt;/del&gt;= &quot;))&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;q &lt;/ins&gt;= float(input(&quot;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;q &lt;/ins&gt;= &quot;))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#Division med a&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#Division med a&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;b &lt;/del&gt;= &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;b &lt;/del&gt;/ a&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;p &lt;/ins&gt;= &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;p &lt;/ins&gt;/ a&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;c &lt;/del&gt;= &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;c &lt;/del&gt;/ a&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;q &lt;/ins&gt;= &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;q &lt;/ins&gt;/ a&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Vi löser ekvationen med p-q formeln&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# Vi löser ekvationen med p-q formeln&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;d = (&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;b &lt;/del&gt;/ 2)**2 - &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;c &lt;/del&gt;  #beräkna värdet för uttrycket under kvadratroten ...&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;d = (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;p &lt;/ins&gt;/ 2)**2 - &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;q &lt;/ins&gt;  #beräkna värdet för uttrycket under kvadratroten ...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;x = - &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;b &lt;/del&gt;/ 2          # symmetrilinjen&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;x = - &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;p &lt;/ins&gt;/ 2          # symmetrilinjen&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;if d &amp;lt; 0:  # Komplexa lösningar&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;if d &amp;lt; 0:  # Komplexa lösningar&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Hakan</name></author>
	</entry>
	<entry>
		<id>https://wikiskola.se/index.php?title=Andragradsekvation_Python&amp;diff=46195&amp;oldid=prev</id>
		<title>Hakan: Skapade sidan med &#039;Kategori:Python Kategori:Ma2c Kategori:Algebra   {{python|Python-hjälp och [https://wikiskola.se/index.php?title{{=}}Kategori:Python Fler uppgifter]}}...&#039;</title>
		<link rel="alternate" type="text/html" href="https://wikiskola.se/index.php?title=Andragradsekvation_Python&amp;diff=46195&amp;oldid=prev"/>
		<updated>2018-04-01T11:29:34Z</updated>

		<summary type="html">&lt;p&gt;Skapade sidan med &amp;#039;&lt;a href=&quot;/index.php/Kategori:Python&quot; title=&quot;Kategori:Python&quot;&gt;Kategori:Python&lt;/a&gt; &lt;a href=&quot;/index.php/Kategori:Ma2c&quot; title=&quot;Kategori:Ma2c&quot;&gt;Kategori:Ma2c&lt;/a&gt; &lt;a href=&quot;/index.php/Kategori:Algebra&quot; title=&quot;Kategori:Algebra&quot;&gt;Kategori:Algebra&lt;/a&gt;   {{python|&lt;a href=&quot;/index.php/Python&quot; title=&quot;Python&quot;&gt;Python-hjälp&lt;/a&gt; och [https://wikiskola.se/index.php?title{{=}}Kategori:Python Fler uppgifter]}}...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Ny sida&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Kategori:Python]] [[Kategori:Ma2c]] [[Kategori:Algebra]]  &lt;br /&gt;
{{python|[[Python|Python-hjälp]] och [https://wikiskola.se/index.php?title{{=}}Kategori:Python Fler uppgifter]}}&lt;br /&gt;
{{malruta| &amp;#039;&amp;#039;&amp;#039;Kom igång med programmering i matematiken.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Målet är att du ska använda program för att utföra matematiska beräkningar. &lt;br /&gt;
Du bör testa att modifiera algoritmen så att dina beräkningar blir mer effektiva.&lt;br /&gt;
&lt;br /&gt;
Målet är inte att du ska lära dig programmering på matematiklektionen men det är oundvikligt att du ändå lär dig lite Python-kod. &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Lös andragradsekvationer med ett Pythonprogram ==&lt;br /&gt;
&lt;br /&gt;
{{uppgruta| &amp;#039;&amp;#039;&amp;#039;Andragradsekvationen&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# Hur gör programmet för att lösa andragradsekvationen?&lt;br /&gt;
# Gör du på samma sätt?&lt;br /&gt;
}}&lt;br /&gt;
{{clear}}&lt;br /&gt;
&lt;br /&gt;
== Python-koden ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
from math import *&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Programmet löser en andragradsekvation av typen ax\u00b2+bx+c=0\n&amp;quot;)&lt;br /&gt;
a = float(input(&amp;quot;a = &amp;quot;))&lt;br /&gt;
b = float(input(&amp;quot;b = &amp;quot;))&lt;br /&gt;
c = float(input(&amp;quot;c = &amp;quot;))&lt;br /&gt;
&lt;br /&gt;
#Division med a&lt;br /&gt;
b = b / a&lt;br /&gt;
c = c / a&lt;br /&gt;
&lt;br /&gt;
# Vi löser ekvationen med p-q formeln&lt;br /&gt;
d = (b / 2)**2 - c   #beräkna värdet för uttrycket under kvadratroten ...&lt;br /&gt;
x = - b / 2          # symmetrilinjen&lt;br /&gt;
&lt;br /&gt;
if d &amp;lt; 0:  # Komplexa lösningar&lt;br /&gt;
    i = round(sqrt(-d),2)  # beräknar imaginära delen&lt;br /&gt;
    print(&amp;quot;Två komplexa lösningar: x\u2081 = &amp;quot; + str(round(x,2)) + &amp;quot; + &amp;quot; + str(i) + &amp;quot;i och x\u2082 = &amp;quot; + str(round(x,2)) + &amp;quot; - &amp;quot; +str(i) + &amp;quot;i.&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
elif  d == 0: &lt;br /&gt;
    print(&amp;quot;En dubbelrot: x = &amp;quot; + str(round(x,2)))&lt;br /&gt;
else:&lt;br /&gt;
    x1 = round(x+sqrt(d),2)&lt;br /&gt;
    x2 = round(x-sqrt(d),2)&lt;br /&gt;
    print(&amp;quot;Två reella lösningar: x\u2081 = &amp;quot; + str(x1) + &amp;quot; och x\u2082 = &amp;quot; + str(x2))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Uppgiften är inspirerad av Malmö stads [https://sites.google.com/skola.malmo.se/programmeringsfortbildning/kursmaterial/tr%C3%A4ff-2?authuser=0 Matematisk programmering i Python]&lt;/div&gt;</summary>
		<author><name>Hakan</name></author>
	</entry>
</feed>