{"id":9236,"date":"2016-05-29T12:26:25","date_gmt":"2016-05-29T16:26:25","guid":{"rendered":"http:\/\/cscircles.cemc.uwaterloo.ca\/?page_id=9236"},"modified":"2017-06-29T13:35:31","modified_gmt":"2017-06-29T17:35:31","slug":"zh-7b","status":"publish","type":"page","link":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/zh-7b\/","title":{"rendered":"7B: \u6570\u5b66"},"content":{"rendered":"<!-- Please retain this notice and add more notes if you create a new version.<br \/>\nOriginal lesson author: Graeme Kemkes, gdkemkes@alumni.uwaterloo.ca, http:\/\/cscircles.ca<br \/>\nLicense: http:\/\/creativecommons.org\/licenses\/by-nc-sa\/3.0\/-->\n<p><em>\u7b2c\u4e03\u8bfe\u6709\u4e09\u4e2a\u90e8\u5206A, B, C\uff0c\u987a\u5e8f\u4e0d\u9650\u3002<\/em><\/p>\n<p>\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u4eec\u901a\u8fc7\u4f7f\u7528Python\u7684\u8fd0\u7b97\u7b26<code>+<\/code>, \u00a0<code>-<\/code>, <code>*<\/code>,\u00a0<code>\/<\/code>\u548c\u65b9\u7a0b<code>max<\/code> and\u00a0<code>min<\/code>\u8fdb\u884c\u4e86\u4e00\u4e9b\u6570\u5b66\u8fd0\u7b97\u3002\u5728\u8fd9\u8282\u8bfe\u4e2d\uff0c\u6211\u4eec\u4f1a\u770b\u5230\u66f4\u591a\u7684\u8fd0\u7b97\u7b26\u548c\u65b9\u7a0b\uff0c\u5c06\u4f1a\u5b66\u4e60\u5982\u4f55\u8fdb\u884c\u66f4\u590d\u6742\u7684\u8fd0\u7b97\u3002<\/p>\n<h2>\u6570\u5b66\u8fd0\u7b97\u7b26\u53f7<\/h2>\n<p>\u6211\u4eec\u5df2\u7ecf\u770b\u5230\u4e86\u8be5\u5982\u4f55\u4f7f\u7528\u8fd0\u7b97\u7b26\u8fdb\u884c\u52a0 (<code>a + b<\/code>)\uff0c\u51cf(<code>a - b<\/code>)\uff0c\u4e58(<code>a * b<\/code>)\uff0c\u9664(<code>a \/ b<\/code>)\u3002\u6211\u4eec\u73b0\u5728\u6765\u5b66\u4e60\u4e09\u4e2a\u65b0\u7684\u8fd0\u7b97\u7b26\u3002<\/p>\n<ul>\n<li><strong>\u5e42<\/strong>\u8fd0\u7b97\u7b26<code>a ** b<\/code>\u5f97\u51fa<code>a<sup>b<\/sup><\/code> (<code>b<\/code>\u4e2a<code>a<\/code>\u76f8\u4e58)\u3002\u6bd4\u5982\uff0c<code>2 ** 3<\/code>\u5c31\u662f<code>8<\/code>\u00a0(2\u00d72\u00d72)\u3002<\/li>\n<li><strong>\u6574\u6570\u9664\u6cd5<\/strong>\u8fd0\u7b97\u7b26<code>a \/\/ b<\/code>\u8ba1\u7b97<code>a<\/code> \u9664\u4ee5<code>b<\/code>\u7684\u5546\u7684\u6574\u6570\u90e8\u5206\uff0c\u5ffd\u7565\u4f59\u6570\u3002\u6bd4\u5982\uff0c<code>14 \/\/ 3<\/code>\u662f<code>4<\/code>\u3002\/li&gt;<\/li>\n<li><strong>\u6a21<\/strong>\u8fd0\u7b97\u7b26<code>a % b<\/code>\u8ba1\u7b97<code>a<\/code>\u9664\u4ee5<code>b<\/code>\u7684\u4f59\u6570\u3002\u6bd4\u5982\uff0c<code>14 % 3<\/code>\u662f<code>2<\/code>\u3002<\/li>\n<\/ul>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform0\" method=\"POST\">\n<div class='pybox modeNeutral  facultative' id='pybox0'>\n<div class=\"heading\"><span class=\"title\">Example<\/span><\/div>\u5e42\uff0c\u6574\u6570\u9664\u6cd5\uff0c\u548c\u6a21\u8fd0\u7b97\u7b26\u3002<div class='pyboxTextwrap pyboxCodewrap RO '  style='height: 84px;'><textarea wrap='off' name='usercode0' id='usercode0'  cols=10 rows=3 readonly='readonly'  style = 'height : 84px;'  class='pyboxCode RO'>\nprint(2 ** 3)\nprint(14 \/\/ 3)\nprint(14 % 3)<\/textarea><\/div>\n<div id='pbhistory0' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit0' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(0)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(0,'N')\" ><\/td>\n<\/tr><\/table><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse0\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"0\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"a3511b91883033660b56dabaf0837468\"\/>\n<div id='pbresults0' class='pbresults'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>document.getElementById(\"submit0\").value = \"Run program\";document.getElementById(\"inputInUse0\").value = \"N\";<\/script>\n<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform1\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox1'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>\u9e21\u86cb\u88c5\u7bb1<\/span><\/div>\u6bcf\u4e2a\u86cb\u7bb1\u670912\u4e2a\u9e21\u86cb\u3002\u5199\u4e00\u4e2a\u7a0b\u5e8f\uff0c<code>input()<\/code>\u8bfb\u53d6\u4e00\u4e2a\u6574\u6570\uff0c\u6253\u5370\u51fa\u4e24\u4e2a\u6570\u5b57\uff1a\u8fd9\u4e9b\u9e21\u86cb\u80fd\u88c5\u591a\u5c11\u86cb\u7bb1\uff0c\u8fd8\u6709\u591a\u5c11\u4e2a\u9e21\u86cb\u5269\u4e0b\u3002\u6bd4\u5982\u8bf4\uff0c\u8f93\u5165<code>27<\/code>\uff0c\u6253\u5370\u51fa<\/p>\n<pre>2\r\n3<\/pre>\u56e0\u4e3a<code>27<\/code>\u4e2a\u9e21\u86cb\u80fd\u88c5<code>2<\/code>\u86cb\u7bb1\uff0c\u5269\u4e0b<code>3<\/code>\u4e2a\u9e21\u86cb\u3002<a class=\"hintlink\"  id=\"hintlink2\">\u63d0\u793a<\/a><\/p>\n<div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode1' id='usercode1'  cols=10 rows=20   class='pyboxCode RW'>\n<\/textarea><\/div>\n<div id='pbhistory1' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit1' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(1)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(1,'N')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(1,'7b.eggs')\" ><\/td>\n<\/tr><\/table><select id='pbSelect1' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='help' data-pbonclick=\"helpClick(1);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse1\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"1\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"95fc112c954e68c18d29b2bfef4e7ea4\"\/>\n<div id='pbresults1' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(1);});document.getElementById(\"submit1\").value = \"Run program\";document.getElementById(\"inputInUse1\").value = \"N\";<\/script>\n<\/p>\n<p>\u6a21\u8fd0\u7b97\u7b26\u5e94\u7528\u5e7f\u6cdb\u3002\u4f8b\u5982\uff1a<\/p>\n<ul>\n<li>\u5982\u679c\u73b0\u5728\u662f10\u70b9\uff0c100\u4e2a\u5c0f\u65f6\u4e4b\u540e\u662f\u51e0\u70b9\uff1f\uff08\u9700\u8981\u6a2112\uff09<\/li>\n<li>2032\u662f\u95f0\u5e74\u4e48\uff1f(<a href=\"http:\/\/en.wikipedia.org\/wiki\/Leap_year\">\u9700\u8981\u6a214\uff0c100\uff0c\u548c400<\/a>)<\/li>\n<\/ul>\n<p>\u67e5\u770b\u662f\u4e0d\u662f\u95f0\u5e74\u662f\u6574\u9664\u6027\u6d4b\u8bd5 \u7684\u4e00\u4e2a\u4f8b\u5b50\uff1b\u5728\u4e0b\u4e00\u4e2a\u7ec3\u4e60\u4e2d\u4f60\u4f1a\u5199\u4e00\u4e2a\u7a0b\u5e8f\uff0c\u8fd0\u884c\u901a\u7528\u7684\u9664\u6cd5\u6d4b\u8bd5\u3002<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform3\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox3'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>\u6574\u9664\u6027<\/span><\/div>\u5199\u4e00\u4e2a\u7a0b\u5e8f\uff0c\u5728\u4e0d\u540c\u7684\u4e24\u884c\u8bfb\u53d6\u5206\u522b\u4e24\u4e2a\u6b63\u6574\u6570<code>a<\/code>\u548c<code>b<\/code>\u3002\u5982\u679c<code>a<\/code>\u80fd\u88ab<code>b<\/code>\u6574\u9664\uff0c\u90a3\u4e48\u6253\u5370\"divisible\"\u3002\u5426\u5219\uff0c\u6253\u5370\"not divisible\"\u3002\u6bd4\u5982\uff0c\u5f53\u8f93\u5165\u662f<\/p>\n<pre>14\r\n3<\/pre>\u7a0b\u5e8f\u6253\u5370\u51fa\"not divisible\"\u3002<a class=\"hintlink\"  id=\"hintlink4\">\u63d0\u793a<\/a><div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode3' id='usercode3'  cols=10 rows=20   class='pyboxCode RW'>\n<\/textarea><\/div>\n<div id='pbhistory3' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit3' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(3)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(3,'N')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(3,'7b.divisible')\" ><\/td>\n<\/tr><\/table><select id='pbSelect3' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='help' data-pbonclick=\"helpClick(3);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse3\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"3\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"22690c13b2daf714c40be6bd0e8aabba\"\/>\n<div id='pbresults3' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(3);});document.getElementById(\"submit3\").value = \"Run program\";document.getElementById(\"inputInUse3\").value = \"N\";<\/script>\n<\/p>\n<h2>\u6570\u5b66\u65b9\u7a0b<\/h2>\n<p>Python\u53ef\u4ee5\u8ba1\u7b97\u5927\u90e8\u5206\u80fd\u5728\u79d1\u5b66\u8ba1\u7b97\u5668\u4e0a\u627e\u5230\u7684\u6570\u5b66\u65b9\u7a0b\u3002<\/p>\n<ul>\n<li><code>sqrt(x)<\/code>\u8ba1\u7b97<code>x<\/code>\u7684\u7b97\u672f\u5e73\u65b9\u6839\u3002<\/li>\n<li><code>exp(x)<\/code>\u548c<code>log(x)<\/code>\u662f\u6307\u6570\u65b9\u7a0b\u548c\u5bf9\u6570\u65b9\u7a0b\u3002<\/li>\n<li><code>sin(x)<\/code>, <code>cos(x)<\/code>, <code>tan(x)<\/code>\u7b49\u4e09\u89d2\u51fd\u6570\u65b9\u7a0b\u3002<\/li>\n<li><code>Pi \u662f\u6307 3.1415<\/code>\u3002<\/li>\n<\/ul>\n<p><table class='pywarn'><tr><td class='pywarnleft'><img src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/warning.png'\/><\/td><td class='pywarnright'><span> \u5f53\u4f7f\u7528Python\u7684\u4e09\u89d2\u51fd\u6570\u65b9\u7a0b\u65f6\uff0c<code>x<\/code>\u4e00\u5b9a\u8981\u4f7f\u7528\u5f27\u5ea6\u5236\uff0c\u800c\u4e0d\u662f\u89d2\u5ea6\u5236\u3002 <\/span><\/td><\/table><\/p>\n<p>Python\u5c06\u8fd9\u4e9b\u5927\u91cf\u7684\u65b9\u7a0b\u6536\u5165\u4e00\u4e2a\u53eb\u505a<em>\u6a21\u5757<\/em>\u7684\u96c6\u5408\u91cc\u3002\u4ee5\u4e0a\u7684\u65b9\u7a0b\u5c5e\u4e8e<code>math<\/code>\u6a21\u5757\u3002\u5728\u4f7f\u7528\u4efb\u4f55\u6a21\u5757\u91cc\u7684\u65b9\u7a0b\u524d\uff0c\u4f60\u9700\u8981<em>\u5bfc\u5165<\/em>\u6a21\u5757\uff0c\u4e0b\u9762\u662f\u4e00\u4e2a\u4f8b\u5b50\u3002\u4e3a\u4e86\u4f7f\u7528\u4e00\u4e2a\u6a21\u5757\u4e2d\u7684\u65b9\u7a0b\uff0c\u4f60\u9700\u8981\u4f9d\u6b21\u8f93\u5165\u6a21\u5757\u7684\u540d\u5b57\uff0c\u4e00\u4e2a\u53e5\u53f7\uff0c\u65b9\u7a0b\u7684\u540d\u5b57\u3002<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform5\" method=\"POST\">\n<div class='pybox modeNeutral  facultative' id='pybox5'>\n<div class=\"heading\"><span class=\"title\">Example<\/span><\/div>\u4f7f\u7528\u6570\u5b66\u6a21\u5757\u4e2d\u7684\u65b9\u7a0b<div class='pyboxTextwrap pyboxCodewrap RO '  style='height: 136px;'><textarea wrap='off' name='usercode5' id='usercode5'  cols=10 rows=5 readonly='readonly'  style = 'height : 136px;'  class='pyboxCode RO'>\nimport math\nprint(math.pi)\ne = math.exp(1)\nprint(e)\nprint(math.sqrt(3), math.tan(math.pi \/ 3))<\/textarea><\/div>\n<div id='pbhistory5' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit5' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(5)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(5,'N')\" ><\/td>\n<\/tr><\/table><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse5\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"5\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"f6885f61429ba7ceee96a03033a06e45\"\/>\n<div id='pbresults5' class='pbresults'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>document.getElementById(\"submit5\").value = \"Run program\";document.getElementById(\"inputInUse5\").value = \"N\";<\/script>\n<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform6\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox6'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>\u5706\u5f62\u62ab\u8428<\/span><\/div>\u4f60\u7684\u670b\u53cb\u4eec\u5df2\u7ecf\u5403\u4e86\u4ed6\u4eec\u7684\u65b9\u5f62\u62ab\u8428\uff0c\u73b0\u5728\u5728\u8ba2\u8d2d\u5706\u5f62\u7684\u62ab\u8428\u3002\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f\u6765\u8ba1\u7b97\u51fa\u8fd9\u4e2a\u5706\u5f62\u62ab\u8428\u7684\u9762\u79ef\u3002\u8f93\u5165\u503c\u662f<code>float<\/code> <em>r<\/em>\uff0c\u4ee3\u8868\u534a\u5f84\uff08cm\uff09\u3002\u8f93\u51fa\u5e94\u8be5\u662f\u9762\u79ef\uff08cm<sup>2<\/sup>\uff09\uff0c\u516c\u5f0f\u662f<em>A=pi*r<sup>2<\/sup><\/em>\u3002\u4f7f\u7528Python\u4e2d\u7684<code>pi<\/code>\uff0c\u4e0d\u8981\u8f93\u5165<code>3.1415...<\/code><div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode6' id='usercode6'  cols=10 rows=20   class='pyboxCode RW'>\n<\/textarea><\/div>\n<div id='pbhistory6' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit6' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(6)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(6,'N')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(6,'7b.pizza')\" ><\/td>\n<\/tr><\/table><select id='pbSelect6' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='help' data-pbonclick=\"helpClick(6);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse6\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"6\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"031e79f7f612ecf178cef4d6f6521407\"\/>\n<div id='pbresults6' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(6);});document.getElementById(\"submit6\").value = \"Run program\";document.getElementById(\"inputInUse6\").value = \"N\";<\/script>\n<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform7\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox7'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>\u7b49\u6bd4\u4e2d\u9879<\/span><\/div>\u4e24\u4e2a\u6570<code>a<\/code>\u548c<code>b<\/code>\u7684<em>\u7b49\u6bd4\u4e2d\u9879<\/em>\u662f<\/p>\n<p style=\"text-align: center;\"><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Csqrt%7Bab%7D&#038;bg=T&#038;fg=000000&#038;s=2' alt='\\sqrt{ab}' title='\\sqrt{ab}' class='latex' \/><\/p>\n<p>\uff08\u7528\u6765\u6bd4\u8f83\u663e\u793a\u5c4f\u7684\u6a2a\u7eb5\u6bd4\uff0c\u63cf\u8ff0\u4eba\u53e3\u7684\u5e73\u5747\u589e\u957f\u7387\uff09\u3002\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f\uff0c\u8bfb\u53d6\u4e24\u884c\u6b63\u7684<code>float<\/code>\uff0c\u8f93\u51fa\u4ed6\u4eec\u7684\u7b49\u6bd4\u4e2d\u9879\u3002<br\/> <em>\u4f8b\u5982<\/em>\uff1a\u5982\u679c\u8f93\u5165\u662f<\/p>\n<pre>5.0\r\n20.0<\/pre>\u90a3\u4e48\u8f93\u51fa\u5c31\u5e94\u8be5\u662f<code>10.0<\/code>\u3002<div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode7' id='usercode7'  cols=10 rows=20   class='pyboxCode RW'>\n<\/textarea><\/div>\n<div id='pbhistory7' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit7' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(7)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(7,'N')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(7,'7b.geometricmean')\" ><\/td>\n<\/tr><\/table><select id='pbSelect7' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='help' data-pbonclick=\"helpClick(7);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse7\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"7\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"37a4fde7215547edf9fad3b640d57213\"\/>\n<div id='pbresults7' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(7);});document.getElementById(\"submit7\").value = \"Run program\";document.getElementById(\"inputInUse7\").value = \"N\";<\/script>\n<\/p>\n<h2>\u628a\u5b83\u4eec\u653e\u5728\u4e00\u8d77<\/h2>\n<p>\u6b63\u5982\u4f60\u5728\u4e4b\u524d\u7684\u8054\u7cfb\u6240\u770b\u5230\u7684\u90a3\u6837\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u7ed3\u5408\u8fd0\u7b97\u7b26\u6765\u5efa\u7acb\u6570\u5b66\u8868\u8fbe\u5f0f\u3002Python\u901a\u8fc7\u4f7f\u7528\u201c\u8fd0\u7b97\u987a\u5e8f\u201d\u6765\u8ba1\u7b97\uff1a<\/p>\n<p style=\"padding-left: 30px;\">\u5148\u662f<strong>B<\/strong>rackets\uff08\u62ec\u53f7\uff09\uff0c\u7136\u540e\u662fthen <strong>E<\/strong>xponents\uff08\u6307\u6570\uff09\uff0c\u7136\u540e\u662f<strong>D<\/strong>ivision\uff08\u9664\u6cd5\uff09\u548c<strong>M<\/strong>ultiplication\uff08\u4e58\u6cd5\uff09\uff0c\u6700\u540e\u662f<strong>A<\/strong>ddition\uff08\u52a0\u6cd5\uff09\u548c<strong>S<\/strong>ubtraction\uff08\u51cf\u6cd5\uff09\u3002<\/p>\n<p>\u8fd9\u4e2a\u6cd5\u5219\u53ef\u4ee5\u7f29\u5199\u6210\"BEDMAS\"\u3002\u6574\u6570\u9664\u6cd5\u548c\u6a21\u53ef\u4ee5\u5f52\u5165\"\u9664\u6cd5\u548c\u4e58\u6cd5\"\u7c7b\u3002\u6bd4\u5982\uff0c<\/p>\n<pre>3 * (1 + 2) ** 2 % 4<\/pre>\u7b2c\u4e00\u90e8\u662f\u8ba1\u7b97\u5c0f\u62ec\u53f7(1+2 = 3)\uff0c\u7136\u540e\u662f\u6307\u6570(3 ** 2 = 9)\uff0c\u7136\u540e\u662f\u4e58\u6cd5(3 * 9 = 27)\uff0c\u6700\u540e\u662f\u6a2127 % 4 =\u00a0<code>3<\/code>.<\/p>\n<p><div class='pybox modeNeutral' id='pybox8'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Short Answer Exercise: <\/span><span class='title'>\u8fd0\u7b97\u987a\u5e8f<\/span><\/div>\u8ba1\u7b97Python\u8868\u8fbe\u5f0f<\/p>\n<pre>6 - 52 \/\/ 5 ** 2<\/pre><label for=\"pyShortAnswer8\">Your answer (enter a number): <\/label><input type=\"text\" onkeypress=\"{if (event.keyCode==13) pbShortCheck(8)}\" id=\"pyShortAnswer8\"><div class=\"pyboxbuttons\"><input type=\"hidden\" name=\"type\" value=\"number\"\/><input type=\"hidden\" name=\"correct\" value=\"4\"\/><input type=\"hidden\" name=\"slug\" value=\"7b.bedmas\"\/><input type=\"hidden\" name=\"lang\" value=\"\"\/><input type='submit' style='margin:5px;' value='Check answer' onClick = 'pbShortCheck(8)'\/><\/div><div class=\"pbresults\" id=\"pyShortResults8\"><\/div><div class=\"epilogue\">Correct!<\/div><\/div>\n<p><em>\u6d89\u53ca\u5230\u8d1f\u6570\u7684\u6574\u6570\u9664\u6cd5<\/em>\uff1a\u5f53<code>a<\/code>\u548c<code>b<\/code>\u90fd\u662f\u6b63\u6570\uff0c\u8868\u8fbe\u5f0f<code>a \/\/ b<\/code>\u548c<code>int(a \/ b)<\/code>\u662f\u4e00\u6837\u7684\u3002\u7136\u800c\uff0c\u5f53<code>a<\/code>\u662f\u8d1f\u6570\u65f6\uff0c<code>a \/\/ b<\/code>\u91c7\u53d6\"\u5411\u8d1f\u65e0\u7a77\u9760\u8fd1\"\u539f\u5219\uff0c<code>int(a \/ b)<\/code>\u91c7\u53d6\"\u5411\u96f6\u9760\u8fd1\"\u539f\u5219\u3002<br \/>\n<form class=\"pbform\" action=\"#\" id=\"pbform9\" method=\"POST\">\n<div class='pybox modeNeutral  facultative' id='pybox9'>\n<div class=\"heading\"><span class=\"title\">Example<\/span><\/div> \u6d89\u53ca\u5230\u8d1f\u6570\u7684\u6574\u6570\u9664\u6cd5 <div class='pyboxTextwrap pyboxCodewrap RO '  style='height: 58px;'><textarea wrap='off' name='usercode9' id='usercode9'  cols=10 rows=2 readonly='readonly'  style = 'height : 58px;'  class='pyboxCode RO'>\nprint((-10) \/\/ 3, int((-10) \/ 3)) # different\nprint((-12) \/\/ 2, int((-12) \/ 2)) # same, only because 2 divides evenly into -12<\/textarea><\/div>\n<div id='pbhistory9' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit9' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(9)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(9,'N')\" ><\/td>\n<\/tr><\/table><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse9\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"9\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"bdedb8cdc178fc3ce4692432fb63735c\"\/>\n<div id='pbresults9' class='pbresults'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>document.getElementById(\"submit9\").value = \"Run program\";document.getElementById(\"inputInUse9\").value = \"N\";<\/script>\n<\/p>\n<h2>\u6574\u6570\u548c\u5c0f\u6570<\/h2>\n<p>\u6570\u5b66\u8868\u8fbe\u5f0f\u7684\u7ed3\u679c\u662f\u4e00\u4e2a\u6570\u3002\u6b63\u5982\u6211\u4eec<a title=\"4: Types\" href=\"\/zh-4\/\">\u4e4b\u524d<\/a>\u6240\u770b\u5230\u7684\u4e00\u6837\uff0c\u6bcf\u4e00\u4e2a\u6570\u90fd\u4ee5\u4e0b\u9762\u4e24\u79cd\u5f62\u5f0f\u4e2d\u7684\u4e00\u79cd\u50a8\u5b58\uff1a<code>int<\/code>\u6216<code>float<\/code>\u3002<code>int<\/code>\u4ee3\u8868\u6574\u6570\uff0c\u4e0d\u8bba\u6b63\u8d1f\uff0c\u6ca1\u6709\u5927\u5c0f\u9650\u5236\u3002<\/p>\n<p><table class='pywarn'><tr><td class='pywarnleft'><img src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/warning.png'\/><\/td><td class='pywarnright'><span> Python\u4e0d\u63a5\u53d7<code>1 000 000<\/code>\u6216<code>1,000,000<\/code>\u5f62\u5f0f\u7684\u6570\u5b57\u3002\u53ea\u63a5\u53d7<code>1000000<\/code>\u7684\u5f62\u5f0f\u3002 <\/span><\/td><\/table><\/p>\n<p>T<code>float<\/code>\u4ee3\u8868\u5c0f\u6570\u3002\u5c31\u50cf\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u8ba1\u7b97\u673a\uff0c\u5c06<code>1\/3<\/code>\u4ee5<code>0.33333333<\/code>\u7684\u5f62\u5f0f\u50a8\u5b58\uff0cPython\u4e5f\u5c06\u5c0f\u6570\u4ee5\u8fd1\u4f3c\u503c\u7684\u5f62\u5f0f\u50a8\u5b58\u3002<table class='pywarn'><tr><td class='pywarnleft'><img src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/warning.png'\/><\/td><td class='pywarnright'><span> \u56e0\u4e3aPython\u4f7f\u7528\u5c0f\u6570\u7684\u8fd1\u4f3c\u503c\uff0c\u67d0\u4e9b\u65b9\u7a0b\u4ece\u6570\u5b66\u89d2\u5ea6\u4e0a\u770b\u662f\u5bf9\u7684\uff0c\u4f46\u662f\u5728Python\u91cc\u9762\u5c31\u4e0d\u5bf9\u3002  <form class=\"pbform\" action=\"#\" id=\"pbform10\" method=\"POST\">\n<div class='pybox modeNeutral  facultative' id='pybox10'>\n<div class=\"heading\"><span class=\"title\">Example<\/span><\/div><div class='pyboxTextwrap pyboxCodewrap RO '  style='height: 110px;'><textarea wrap='off' name='usercode10' id='usercode10'  cols=10 rows=4 readonly='readonly'  style = 'height : 110px;'  class='pyboxCode RO'>\nimport math\ns = math.sqrt(2) * math.sqrt(2)\nprint(s == 2)\nprint(s)<\/textarea><\/div>\n<div id='pbhistory10' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit10' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(10)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(10,'N')\" ><\/td>\n<\/tr><\/table><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse10\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"10\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"b416006b57a6ea47b55211769d6b5292\"\/>\n<div id='pbresults10' class='pbresults'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>document.getElementById(\"submit10\").value = \"Run program\";document.getElementById(\"inputInUse10\").value = \"N\";<\/script>\n  <form class=\"pbform\" action=\"#\" id=\"pbform11\" method=\"POST\">\n<div class='pybox modeNeutral  facultative' id='pybox11'>\n<div class=\"heading\"><span class=\"title\">Example<\/span><\/div><div class='pyboxTextwrap pyboxCodewrap RO '  style='height: 84px;'><textarea wrap='off' name='usercode11' id='usercode11'  cols=10 rows=3 readonly='readonly'  style = 'height : 84px;'  class='pyboxCode RO'>\ns = 0.1 + 0.1 + 0.1\nprint('s equals 0.3?', s == 0.3)\nprint('s =', s)<\/textarea><\/div>\n<div id='pbhistory11' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit11' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(11)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(11,'N')\" ><\/td>\n<\/tr><\/table><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse11\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"11\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"152b3da4460191b4c80831387738e623\"\/>\n<div id='pbresults11' class='pbresults'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>document.getElementById(\"submit11\").value = \"Run program\";document.getElementById(\"inputInUse11\").value = \"N\";<\/script>\n  \u5bf9\u4e8e\u8fd9\u8282\u8bfe\u6765\u8bf4\uff0c\u5f53\u6211\u4eec\u6bd4\u8f83<code>\u6d6e\u70b9\u6570<\/code>\u7684\u65f6\u5019\uff0c\u6211\u4eec\u5141\u8bb8\u4e00\u4e9b\u8fd1\u4f3c\u503c\u3002\u6bd4\u5982\uff0c\u5728\u672c\u7f51\u7ad9\u7684\u5185\u90e8\u6253\u5206\u8f6f\u4ef6\u4e2d\uff0c\u4efb\u4f55<code>\u6d6e\u70b9\u6570<\/code>\u8f93\u51fa\u90fd\u4f1a\u88ab\u6253\u5206\u4e3a\u6b63\u786e\u5982\u679c\u5b83\u662f<a class=\"hintlink\"  id=\"hintlink12\"><em>\u51e0\u4e4e<\/em><\/a>\u7b49\u4e8e\u6b63\u786e\u7b54\u6848\u3002 <\/span><\/td><\/table><\/p>\n<p>\u6211\u4eec\u4ee5\u4e00\u4e9b\u8054\u7cfb\u6765\u7ed3\u675f\u8fd9\u8282\u8bfe\u3002<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform13\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox13'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>\u8003\u9a8c\u6280\u80fd\u7684\u95ee\u9898<\/span><\/div>\u4f5c\u4e3a\u4e00\u4e2a\u201c\u8003\u9a8c\u6280\u80fd\u7684\u95ee\u9898\u201d\uff0c\u4f60\u6709\u4e09\u4e2a\u6574\u6570\uff0c\u5c06\u524d\u4e24\u4e2a\u76f8\u52a0\uff0c\u7136\u540e\u518d\u4e58\u7b2c\u4e09\u4e2a\u6570\u3002<a class=\"hintlink\"  id=\"hintlink14\">\u63d0\u793a<\/a><div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode13' id='usercode13'  cols=10 rows=20   class='pyboxCode RW'>\n<\/textarea><\/div>\n<div id='pbhistory13' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit13' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(13)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(13,'N')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(13,'7b.skill')\" ><\/td>\n<\/tr><\/table><select id='pbSelect13' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='help' data-pbonclick=\"helpClick(13);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse13\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"13\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"bd95ee864ca18821f0cceebddfc73c7b\"\/>\n<div id='pbresults13' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(13);});document.getElementById(\"submit13\").value = \"Run program\";document.getElementById(\"inputInUse13\").value = \"N\";<\/script>\n<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform15\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox15'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>\u4e00\u811a\u4e0e\u4e00\u82f1\u5c3a<\/span><\/div>\u8fd9\u4e2a\u7a0b\u5e8f\u7684\u8f93\u5165\u662f\u4e00\u4e2a\u5c0f\u6570\uff0c\u4ee3\u8868\u7740\u9ad8\u5ea6\uff08\u82f1\u5c3a\uff09\u3002\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f\uff0c\u8f93\u51fa\u76f8\u540c\u7684\u9ad8\u5ea6\u4f46\u662f\u662f\u4ee5\u5398\u7c73\u4e3a\u5355\u4f4d\uff0c\u6362\u7b97\u516c\u5f0f\u662f 1 \u82f1\u5c3a= 30.48 \u5398\u7c73\u3002\u6bd4\u5982\uff0c\u5982\u679c\u8f93\u5165\u662f<code>0.5<\/code>\uff0c\u8f93\u51fa\u5c31\u5e94\u8be5\u662f<code>15.24<\/code>\u3002<div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode15' id='usercode15'  cols=10 rows=20   class='pyboxCode RW'>\n<\/textarea><\/div>\n<div id='pbhistory15' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit15' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(15)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(15,'N')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(15,'7b.convert')\" ><\/td>\n<\/tr><\/table><select id='pbSelect15' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='help' data-pbonclick=\"helpClick(15);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse15\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"15\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"e196b567cf68d0a9748e52f2edca4a16\"\/>\n<div id='pbresults15' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(15);});document.getElementById(\"submit15\").value = \"Run program\";document.getElementById(\"inputInUse15\").value = \"N\";<\/script>\n<\/p>\n<p><form class=\"pbform\" action=\"#\" id=\"pbform16\" method=\"POST\">\n<div class='pybox modeNeutral ' id='pybox16'>\n<img title='You have not yet completed this problem.' src='https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-content\/plugins\/pybox\/files\/icon.png' class='pycheck'\/><div class=\"heading\"><span class='type'>Coding Exercise: <\/span><span class='title'>\u91cd\u529b<\/span><\/div>\u4e00\u4e2a\u5305\u88f9\u4ece\u9ad8\u5ea6\u4e3a11000m\u7684\u98de\u673a\u4e0a\u6254\u4e0b\uff0c\u4ee5\u901f\u5ea6<em>v<\/em> m\/s\u964d\u843d\u3002\u968f\u7740\u5b83\u843d\u4e0b\uff0c\u5b83\u5230\u5730\u9762\u7684\u8ddd\u79bb\u662f-4.9<em>t<\/em><sup>2<\/sup> - <em>vt<\/em> + 11000\uff0c\u5176\u4e2d<em>t<\/em>\u662f\u4ece\u5f00\u59cb\u6254\u4e0b\u5f00\u59cb\u8ba1\u7b97\uff0c\u5355\u4f4d\u662f\u79d2\u3002\u7f16\u5199\u4e00\u4e2a\u7a0b\u5e8f\uff0c\u8f93\u51fa\u5305\u88f9\u4ece\u6254\u5230\u843d\u5730\u6240\u9700\u65f6\u95f4\u3002<em>v<\/em>\u662f\u6b63\u7684\u5c0f\u6570\u3002\u9700\u8981\u7684\u65f6\u95f4\u662f\u6839\u636e\u4e0b\u5217\u516c\u5f0f\u5f97\u5230\u7684\uff1a<\/p>\n<p style=\"text-align: center;\"><img src='https:\/\/s0.wp.com\/latex.php?latex=%5Cdisplaystyle%7Bt%3D%5Cfrac%7Bv-%5Csqrt%7Bv%5E2-4%28-4.9%29%2811000%29%7D%7D%7B2%28-4.9%29%7D%7D&#038;bg=T&#038;fg=000000&#038;s=2' alt='\\displaystyle{t=\\frac{v-\\sqrt{v^2-4(-4.9)(11000)}}{2(-4.9)}}' title='\\displaystyle{t=\\frac{v-\\sqrt{v^2-4(-4.9)(11000)}}{2(-4.9)}}' class='latex' \/><\/p>\n<p><div class=\"helpOuter\" style=\"display: none;\"><div class=\"helpInner\"><div style=\"text-align: center\">You need to create an account and log in to ask a question.<\/div><\/div><\/div><div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode16' id='usercode16'  cols=10 rows=20   class='pyboxCode RW'>\n<\/textarea><\/div>\n<div id='pbhistory16' class='flexcontain' style='display:none;'><\/div>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit16' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(16)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(16,'N')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(16,'7b.gravity')\" ><\/td>\n<\/tr><\/table><select id='pbSelect16' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='help' data-pbonclick=\"helpClick(16);\" >Help<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"\"\/><input type=\"hidden\" id=\"inputInUse16\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"16\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"db850445025c9de71a2b50ea0e6d0704\"\/>\n<div id='pbresults16' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(16);});document.getElementById(\"submit16\").value = \"Run program\";document.getElementById(\"inputInUse16\").value = \"N\";<\/script>\n<\/p>\n<p>\u606d\u559c\uff01\u5728\u5b8c\u6210\u8fd9\u4e9b\u7ec3\u4e60\u4e4b\u540e\uff0c\u4f60\u53ef\u4ee5\u5f00\u59cb\u4e0b\u4e00\u8bfe\u7684\u5b66\u4e60\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b2c\u4e03\u8bfe\u6709\u4e09\u4e2a\u90e8\u5206A, B, C\uff0c\u987a\u5e8f\u4e0d\u9650\u3002 \u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u6211\u4eec\u901a\u8fc7\u4f7f\u7528Python\u7684\u8fd0\u7b97\u7b26+, \u00a0-, *,\u00a0\/\u548c\u65b9\u7a0bmax and\u00a0min\u8fdb\u884c\u4e86\u4e00\u4e9b\u6570\u5b66\u8fd0\u7b97\u3002\u5728\u8fd9\u8282\u8bfe\u4e2d\uff0c\u6211\u4eec\u4f1a\u770b\u5230\u66f4\u591a\u7684\u8fd0\u7b97\u7b26\u548c\u65b9\u7a0b\uff0c\u5c06\u4f1a\u5b66\u4e60\u5982\u4f55\u8fdb\u884c\u66f4\u590d\u6742\u7684\u8fd0\u7b97\u3002 \u6570\u5b66\u8fd0\u7b97\u7b26\u53f7 \u6211\u4eec\u5df2\u7ecf\u770b\u5230\u4e86\u8be5\u5982\u4f55\u4f7f\u7528\u8fd0\u7b97\u7b26\u8fdb\u884c\u52a0 (a + b)\uff0c\u51cf(a - b)\uff0c\u4e58(a * b)\uff0c\u9664(a \/ b)\u3002\u6211\u4eec\u73b0\u5728\u6765\u5b66\u4e60\u4e09\u4e2a\u65b0\u7684\u8fd0\u7b97\u7b26\u3002 \u5e42\u8fd0\u7b97\u7b26a ** b\u5f97\u51faab (b\u4e2aa\u76f8\u4e58)\u3002\u6bd4\u5982\uff0c2 ** 3\u5c31\u662f8\u00a0(2\u00d72\u00d72)\u3002 \u6574\u6570\u9664\u6cd5\u8fd0\u7b97\u7b26a \/\/ b\u8ba1\u7b97a \u9664\u4ee5b\u7684\u5546\u7684\u6574\u6570\u90e8\u5206\uff0c\u5ffd\u7565\u4f59\u6570\u3002\u6bd4\u5982\uff0c14 \/\/ 3\u662f4\u3002\/li&gt; \u6a21\u8fd0\u7b97\u7b26a % b\u8ba1\u7b97a\u9664\u4ee5b\u7684\u4f59\u6570\u3002\u6bd4\u5982\uff0c14 % 3\u662f2\u3002 Example\u5e42\uff0c\u6574\u6570\u9664\u6cd5\uff0c\u548c\u6a21\u8fd0\u7b97\u7b26\u3002 print(2 ** 3) print(14 &hellip; <a href=\"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/zh-7b\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-9236","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/pages\/9236","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/comments?post=9236"}],"version-history":[{"count":12,"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/pages\/9236\/revisions"}],"predecessor-version":[{"id":10252,"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/pages\/9236\/revisions\/10252"}],"wp:attachment":[{"href":"https:\/\/cscircles.cemc.uwaterloo.ca\/dev\/wp-json\/wp\/v2\/media?parent=9236"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}