text stringlengths 1 3.55k | source stringlengths 24 207 | emb listlengths 1.02k 1.02k |
|---|---|---|
sorting 101, 120 source code 147, 164, 173, 178, 182, 335, 346, 349 space complexity 108 spanned record 388 spark 372 spatial 230 spatial parallelism 232 spiral model 467 spot / not urgent compute 769 spreadsheet 20 sprint 471 sram 226 stack 217 stack allocation 276 stack frame 334 stack overflow 335 stack pointer ( sp... | openstax_introduction_to_computer_science_-_web | [
-0.005993037484586239,
-0.027391497045755386,
0.031111642718315125,
0.01138767134398222,
-0.01508988719433546,
-0.02003541588783264,
0.020037876442074776,
0.00968623161315918,
0.011968410573899746,
0.06573779881000519,
0.021574288606643677,
0.02837018109858036,
0.030241910368204117,
-0.050... |
, 733, 733, 738 target 103, 120 technical architecture 69 technical reference model 819 technical reference model ( trm ) 818 technological fix 31 telecommand 774 telemetry 774 temporal locality 230 temporal parallelism 232 ternary operator 323 terraform 688, 707 test - driven development ( tdd ) 478 the open group arc... | openstax_introduction_to_computer_science_-_web | [
0.01954064518213272,
-0.03409060090780258,
0.014139062725007534,
0.019571172073483467,
-0.04128076508641243,
-0.0142723573371768,
0.00042543833842501044,
-0.022303739562630653,
0.014926079660654068,
0.046743836253881454,
-0.0009284844854846597,
0.04669555276632309,
0.03241845592856407,
-0.... |
##ed shortest path 124, 125 usability 443, 475, 481 usability testing 480 use case 450 user experience ( ux ) 55 user experience ( ux ) designer 438 user interface ( ui ) 311 user interface / user experience ( ui / ux ) 480 user story 450 v v - model 464 vacuum tube 13 validation 464, 476 value 409 variable 307, 317, 3... | openstax_introduction_to_computer_science_-_web | [
0.01586039923131466,
-0.01740516908466816,
0.013460500165820122,
0.011096839793026447,
-0.04046173393726349,
0.01739293709397316,
-0.002557935891672969,
-0.01581571064889431,
0.0010387165239080787,
0.05473444238305092,
0.0004649509792216122,
0.026950374245643616,
0.047575026750564575,
-0.0... |
566 world wide web consortium ( w3c ) 75 worst - case situation 109 writability 306 x xcode 575, 631 xml dbms 376 y yet another resource negotiator ( yarn ) 414 z zero - knowledge proof 856 zero - knowledge proof ( zkp ) 855 zero - knowledge rollup ( zk - rollup ) 581 zkps 855 934 index access for free at openstax. org... | openstax_introduction_to_computer_science_-_web | [
0.022565210238099098,
-0.008910289034247398,
0.022030632942914963,
0.005370066035538912,
-0.03220674768090248,
-0.025528382509946823,
-0.008156883530318737,
-0.017092447727918625,
-0.022386331111192703,
0.0813610628247261,
0.043941568583250046,
0.02725628763437271,
0.029084183275699615,
-0... |
introduction to python programming senior contributing authors udayan das, saint mary's college of california aubrey lawson, wiley chris mayfield, james madison university narges norouzi, uc berkeley openstax rice university 6100 main street ms - 375 houston, texas 77005 to learn more about openstax, visit https : / / ... | openstax_introduction_to_python_programming_-_web | [
0.0011510765179991722,
0.006894031073898077,
0.019234880805015564,
-0.030615201219916344,
-0.0012140657054260373,
0.016239050775766373,
-0.023636478930711746,
-0.021143833175301552,
-0.02996359020471573,
0.058631714433431625,
-0.02131783403456211,
0.0069924877025187016,
0.017834438011050224,... |
covers, openstax cnx name, openstax cnx logo, openstax tutor name, openstax tutor logo, connexions name, connexions logo, rice university name, and rice university logo are not subject to the license and may not be reproduced without the prior and express written consent of rice university. digital version isbn - 13 97... | openstax_introduction_to_python_programming_-_web | [
-0.022425148636102676,
0.001423632726073265,
0.03937636688351631,
0.022074740380048752,
0.008036875165998936,
0.04528812691569328,
-0.012344597838819027,
-0.026308881118893623,
-0.013749665580689907,
0.017481880262494087,
0.009793697856366634,
0.029507314786314964,
0.025803517550230026,
-0... |
and deedee mcmurtry michelson 20mm foundation national science foundation the open society foundations jumee yhu and david e. park iii brian d. patterson usa - international foundation the bill and stephanie sick fund steven l. smith & diana t. go stand together robin and sandy stuart foundation the stuart family found... | openstax_introduction_to_python_programming_-_web | [
0.011038374155759811,
-0.007240180391818285,
0.017426639795303345,
-0.015528128482401371,
-0.02693343535065651,
0.006100249011069536,
0.002730991691350937,
-0.0021689962595701218,
-0.01447226945310831,
0.021938825026154518,
-0.0029674272518604994,
-0.0078034172765910625,
0.044516392052173615... |
keyword arguments 168 6. 7 chapter summary 170 modules 173 7 introduction 173 7. 1 module basics 174 7. 2 importing names 177 7. 3 top - level code 180 7. 4 the help function 184 7. 5 finding modules 189 7. 6 chapter summary 194 strings 197 8 introduction 197 8. 1 string operations 197 8. 2 string slicing 200 8. 3 sear... | openstax_introduction_to_python_programming_-_web | [
0.02316999062895775,
-0.0025715804658830166,
0.020284464582800865,
-0.020817313343286514,
0.012757621705532074,
-0.019809000194072723,
-0.022459600120782852,
-0.015414337627589703,
-0.010840781033039093,
0.07648582011461258,
0.005405925679951906,
0.029184632003307343,
0.01939825527369976,
... |
14. 3 files in different locations and working with csv files 335 14. 4 handling exceptions 339 14. 5 raising exceptions 344 14. 6 chapter summary 347 data science 349 15 introduction 349 15. 1 introduction to data science 349 15. 2 numpy 352 15. 3 pandas 354 15. 4 exploratory data analysis 362 15. 5 data visualization... | openstax_introduction_to_python_programming_-_web | [
0.017886508256196976,
-0.0002690230030566454,
0.05265624076128006,
-0.03314390778541565,
-0.024365490302443504,
0.003498121863231063,
-0.010542365722358227,
-0.021898694336414337,
-0.003662527073174715,
0.10856108367443085,
0.00487743504345417,
0.03435662016272545,
0.03940395265817642,
-0.... |
15. 6 summary 375 answer key 379 index 403 access for free at openstax. org preface about openstax openstax is part of rice university, which is a 501 ( c ) ( 3 ) nonprofit charitable corporation. as an educational initiative, it's our mission to improve educational access and learning for everyone. through our partner... | openstax_introduction_to_python_programming_-_web | [
-0.004031205549836159,
0.0012853731168434024,
0.002959273522719741,
-0.014482422731816769,
0.009152306243777275,
-0.008947840891778469,
-0.033870212733745575,
-0.020341375842690468,
-0.03983183205127716,
0.054751791059970856,
-0.004221636336296797,
0.02274409495294094,
0.03247043862938881,
... |
license, and can be reused without attribution. for illustrations ( e. g. graphs, charts, etc. ) that are not credited, use the following attribution : copyright rice university, openstax, under cc by 4. 0 license. errata all openstax textbooks undergo a rigorous review process. however, like any professional - grade t... | openstax_introduction_to_python_programming_-_web | [
-0.01913754642009735,
-0.012988002970814705,
0.008236108347773552,
-0.03033401072025299,
-0.017412228509783745,
-0.01760084740817547,
-0.026024071499705315,
-0.03188271448016167,
-0.013235881924629211,
0.07107231765985489,
0.009735058061778545,
0.005458232015371323,
0.03575011342763901,
-0... |
in chapters, with each chapter containing 6 - 8 sections. each section follows the pattern : • learning objectives • 1 – 3 subsections • programming practice the learning objectives are designed to help readers identify the section's focus. each objective completes the sentence, " by the end of this section you should ... | openstax_introduction_to_python_programming_-_web | [
0.035513196140527725,
0.005646912381052971,
-0.02474626898765564,
-0.03483276441693306,
-0.012165780179202557,
-0.012767357751727104,
-0.01751743257045746,
0.009174780920147896,
-0.02050541527569294,
0.060366034507751465,
-0.004933597054332495,
0.023966588079929352,
0.022334501147270203,
0... |
. incorrect answer choices typically represent a misconception or are the result of making a common mistake. even if the correct answer is achieved, readers are encouraged to explore the explanations to gain awareness of these common misconceptions. programming practice exercises each section ends with 1 or 2 practice ... | openstax_introduction_to_python_programming_-_web | [
0.030645407736301422,
-0.008855689316987991,
0.026834562420845032,
0.001327343750745058,
-0.03245900198817253,
-0.009415017440915108,
0.0066892411559820175,
-0.006381564307957888,
-0.026671791449189186,
0.0755491554737091,
0.008715461939573288,
0.028887327760457993,
0.017875228077173233,
-... |
lawson is a cs content developer at zybooks. she received her bachelor's and master's degrees in computer science from clemson university, and her phd research focuses on cs education. chris mayfield, james madison university chris mayfield, phd, is a professor of computer science at james madison university. his resea... | openstax_introduction_to_python_programming_-_web | [
0.030055195093154907,
-0.006815498694777489,
0.024064812809228897,
-0.031540997326374054,
0.008623631671071053,
0.03645092993974686,
-0.028273960575461388,
-0.008273491635918617,
-0.0007158324588090181,
0.0351991169154644,
-0.0264801736921072,
-0.021193256601691246,
0.025448797270655632,
-... |
##himiemona, community college of baltimore county doina bein, cal state fullerton phillip bradford, university of connecticut james braman, community college of baltimore county robert burrows, college of dupage deena engel, new york university gabriel ferrer, hendrix college nazli hardy, millersville university matth... | openstax_introduction_to_python_programming_-_web | [
0.0018550371751189232,
-0.01936609297990799,
0.027167029678821564,
0.03335706889629364,
-0.01499753538519144,
0.006646788213402033,
-0.02231656387448311,
-0.021075604483485222,
0.011533086188137531,
0.06637377291917801,
-0.010611544363200665,
0.041382696479558945,
0.05283082649111748,
-0.0... |
academicintegrity. org / ( https : / / academicintegrity. org / ). community hubs openstax partners with the institute for the study of knowledge management in education ( iskme ) to offer community hubs on oer commons — a platform for instructors to share community - created resources that support openstax books, free... | openstax_introduction_to_python_programming_-_web | [
0.014183888211846352,
0.004752747714519501,
-0.024753516539931297,
0.03521997109055519,
-0.018530309200286865,
-0.0009971775580197573,
-0.033788908272981644,
-0.04438004642724991,
0.00369262951426208,
0.07030574232339859,
-0.014559515751898289,
0.028781546279788017,
0.0359710268676281,
-0.... |
1. 9 chapter summary introduction computers and programs are everywhere in today's world. programs affect many aspects of daily life and society as a whole. people depend on programs for communication, shopping, entertainment, health care, and countless other needs. learning how to program computers opens the door to m... | openstax_introduction_to_python_programming_-_web | [
0.02521343156695366,
-0.006244489457458258,
0.007053084205836058,
-0.026660451665520668,
0.007372165098786354,
-0.005358755588531494,
0.014952157624065876,
0.014964721165597439,
-0.009728082455694675,
0.03455708175897598,
-0.013889082707464695,
0.007262744475156069,
0.013960668817162514,
-... |
1. 1 background learning objectives by the end of this section you should be able to • name two examples of computer programs in everyday life. • explain why python is a good programming language to learn. computer programs a computer is an electronic device that stores and processes information. examples of computers ... | openstax_introduction_to_python_programming_-_web | [
0.035659436136484146,
-0.00679567689076066,
0.010543650016188622,
-0.022919543087482452,
0.015448994003236294,
-0.00845834705978632,
-0.02814173512160778,
0.003566898638382554,
-0.0099231181666255,
0.06807541847229004,
0.014073816128075123,
-0.0026826104149222374,
0.04430157318711281,
-0.0... |
access to online streaming services include spotipy ( https : / / openstax. org / r / 100spotipy ), pytube ( https : / / openstax. org / r / 100pytube ), and pydora ( https : / / openstax. org / r / 100pydora ). python - related tools often have the letters " py " in their name. the python language this book introduces... | openstax_introduction_to_python_programming_-_web | [
0.044282715767621994,
0.005784337874501944,
0.0015039233257994056,
-0.01246427372097969,
0.005684354342520237,
0.018295345827937126,
0.018365757539868355,
0.01254049502313137,
0.0014271694235503674,
0.03991381824016571,
-0.01901794970035553,
0.0009797475067898631,
-0.0010185883147642016,
-... |
line in python : print ( " hello, world! " ) in contrast, the hello world program is five lines in java ( a different language ). public class hello { public static void main ( string [ ] args ) { system. out. println ( " hello, world! " ) ; } } however, conciseness is not the only consideration for which language is u... | openstax_introduction_to_python_programming_-_web | [
0.044462185353040695,
0.0008350317948497832,
-0.019082166254520416,
-0.026193667203187943,
-0.014084937050938606,
-0.0014052026672288775,
0.029707305133342743,
0.003650626167654991,
0.013256790116429329,
0.05128759890794754,
-0.0028660481330007315,
0.030728818848729134,
-0.023978421464562416... |
1. 1 • background 9 concepts in practice python vs java syntax 5. in general, python programs are _ _ _ _ _ than java programs. a. faster b. longer c. shorter 6. in the example programs above, what syntax required by java is not required by python? a. semicolons b. parentheses c. quote marks try it favorite song the pr... | openstax_introduction_to_python_programming_-_web | [
0.011105004698038101,
-0.023173734545707703,
-0.004943131934851408,
-0.04286649823188782,
0.002401110017672181,
-0.0022972743026912212,
0.01672440581023693,
-0.01299318391829729,
0.02301974408328533,
0.04094221815466881,
-0.009503496810793877,
0.03654194995760918,
0.003237068187445402,
-0.... |
1. 2 input / output learning objectives by the end of this section you should be able to • display output using the print ( ) function. • obtain user input using the input ( ) function. basic output the print ( ) function displays output to the user. output is the information or result produced by a program. the sep an... | openstax_introduction_to_python_programming_-_web | [
-0.0015125508652999997,
0.0031707584857940674,
0.011122101917862892,
0.016512446105480194,
-0.012043708004057407,
-0.055122315883636475,
-0.02033137157559395,
-0.00789974071085453,
0.007809371687471867,
0.05977393686771393,
-0.0051627508364617825,
0.03163670003414154,
-0.011301499791443348,
... |
/ pages / 1 - 2 - inputoutput ) concepts in practice the print ( ) function 1. which line of code prints hello world! as one line of output? a. print ( hello world! ) b. print ( " hello ", " world ", "! " ) c. print ( " hello world! " ) 2. which lines of code prints hello world! as one line of output? a. print ( " hell... | openstax_introduction_to_python_programming_-_web | [
0.022906780242919922,
0.014337711036205292,
-0.0014082439010962844,
-0.01970973052084446,
-0.009399781003594398,
-0.04211755096912384,
0.0121309794485569,
0.011168356984853745,
-0.014191670343279839,
0.027820954099297523,
-0.0043931338004767895,
0.0427238792181015,
-0.003108617616817355,
-... |
1. 2 • input / output 11 a. 555 0123 b. 5550123 - c. 555 - 0123 do spaces really matter? spaces and newline characters are not inherently important. however, learning to be precise is an essential skill for programming. noticing little details, like how words are separated and how lines end, helps new programmers becom... | openstax_introduction_to_python_programming_-_web | [
0.01948281191289425,
0.012223969213664532,
0.004156270995736122,
-0.013077729381620884,
-0.0414697527885437,
-0.048889461904764175,
0.016426537185907364,
0.009750031866133213,
-0.04377572610974312,
0.05723850056529045,
0.01000920683145523,
0.01645398885011673,
-0.03415793552994728,
-0.0167... |
enters " six " as the input? print ( " please enter a number : " ) number = input ( ) print ( " value = ", number ) a. value = six b. value = 6 c. value = number try it frost poem write a program that uses multiple print ( ) statements to output the following poem by robert frost ( https : / / openstax. org / r / 100ro... | openstax_introduction_to_python_programming_-_web | [
-0.003127584233880043,
0.015612860210239887,
0.006489933934062719,
-0.002386996289715171,
-0.010749967768788338,
-0.0006076665595173836,
-0.00918949581682682,
-0.006357644218951464,
0.026481868699193,
0.05363534763455391,
0.009660862386226654,
0.032929178327322006,
0.004492332227528095,
-0... |
1. 3 variables learning objectives by the end of this section you should be able to • assign variables and print variables. • explain rules for naming variables. assignment statement variables allow programs to refer to values using names rather than memory locations. ex : age refers to a person's age, and birth refers... | openstax_introduction_to_python_programming_-_web | [
0.027956048026680946,
-0.015308069065213203,
0.011129074729979038,
-0.00784382689744234,
-0.04206535965204239,
-0.020145118236541748,
0.030695701017975807,
-0.009893949143588543,
-0.018377553671598434,
0.03928077220916748,
0.00959750171750784,
-0.0015012031653895974,
0.022250469774007797,
... |
98. 5 = temperature c. temperature - 23. 2 variable naming rules a variable name can consist of letters, digits, and underscores and be of any length. the name cannot start with a digit. ex : 101class is invalid. also, letter case matters. ex : total is different from total. python's style guide recommends writing vari... | openstax_introduction_to_python_programming_-_web | [
0.057137880474328995,
0.006439580582082272,
0.04105759039521217,
0.003247518790885806,
-0.021424002945423126,
0.009773383848369122,
0.050918180495500565,
-0.00398342777043581,
-0.03779216110706329,
0.0661032572388649,
0.04227013885974884,
-0.007443227339535952,
0.005661858711391687,
-0.034... |
1. 3 • variables 15 c. import 6. why is the name, 2nd _ input, not a valid variable name? a. contains an underscore b. starts with a digit c. is a keyword 7. which would be a good name for a variable storing a zip code? a. z b. var _ 2 c. zip _ code 8. given the variable name, dogbreed, which improvement conforms to py... | openstax_introduction_to_python_programming_-_web | [
0.062272969633340836,
-0.008559647016227245,
0.05722419545054436,
-0.019547225907444954,
-0.05514437332749367,
-0.0031993789598345757,
0.026080170646309853,
-0.007216441910713911,
-0.030224066227674484,
0.06619881838560104,
0.0024220733903348446,
0.012194039300084114,
0.006398560479283333,
... |
1. 4 string basics learning objectives by the end of this section you should be able to • use the built - in len ( ) function to get a string's length. • concatenate string literals and variables using the + operator. quote marks a string is a sequence of characters enclosed by matching single (') or double ( " ) quote... | openstax_introduction_to_python_programming_-_web | [
0.0026314579881727695,
-0.013578880578279495,
0.04826568439602852,
0.014538896270096302,
-0.04332976043224335,
-0.021262243390083313,
0.06125995144248009,
0.0028880909085273743,
0.007253048941493034,
0.057345155626535416,
0.0376117005944252,
0.05560392886400223,
0.004111714661121368,
-0.01... |
say " please " to be polite b. " you say " please " to be polite " c.'you say " please " to be polite'len ( ) function a common operation on a string object is to get the string length, or the number of characters in the string. the len ( ) function, when called on a string value, returns the string length. checkpoint ... | openstax_introduction_to_python_programming_-_web | [
0.021620433777570724,
-0.020425068214535713,
0.008629383519291878,
0.008066970854997635,
-0.020675253123044968,
-0.026841986924409866,
0.022034429013729095,
0.009485975839197636,
-0.006098159123212099,
0.049321144819259644,
0.0412120558321476,
0.01942068338394165,
-0.046843018382787704,
-0... |
1. 4 • string basics 17 1 - 4 - string - basics ) concepts in practice applying len ( ) function to string values 5. what is the return value for len ( " hi ali " )? a. 2 b. 5 c. 6 6. what is the length of an empty string variable ( " " )? a. undefined b. 0 c. 2 7. what is the output of the following code? number = " 1... | openstax_introduction_to_python_programming_-_web | [
0.007556832395493984,
-0.008922616951167583,
0.02701079659163952,
0.01047520525753498,
-0.031021559610962868,
-0.055087797343730927,
-0.008726948872208595,
-0.014229564927518368,
-0.0039532543160021305,
0.06998039782047272,
0.034454748034477234,
0.040542978793382645,
-0.02868332341313362,
... |
color " + "! " ) c. print ( " your favorite color is " + color + "! " ) 11. which of the following assigns " one - sided " to the variable holiday? a. holiday = " one " + " sided " b. holiday = one - sided c. holiday = " one - " + " sided " try it name length write a program that asks the user to input their first and ... | openstax_introduction_to_python_programming_-_web | [
0.03338807821273804,
-0.004609626717865467,
0.024038558825850487,
0.0004372426774352789,
-0.05729852616786957,
-0.013099872507154942,
0.02447630651295185,
-0.010961136780679226,
-0.022446872666478157,
0.03362642973661423,
0.027910977602005005,
0.009253486059606075,
-0.004233594983816147,
-... |
1. 5 number basics learning objectives by the end of this section you should be able to • use arithmetic operators to perform calculations. • explain the precedence of arithmetic operators. numeric data types python supports two basic number formats, integer and floating - point. an integer represents a whole number, a... | openstax_introduction_to_python_programming_-_web | [
0.011990603990852833,
-0.016724318265914917,
-0.0022902842611074448,
-0.03479946032166481,
-0.023790713399648666,
-0.01503650564700365,
0.0465279258787632,
-0.007748353760689497,
-0.020628534257411957,
0.08001013100147247,
-0.0024841029662638903,
-0.0054458207450807095,
0.011949270963668823,... |
2. 0 < class'float'> c. 2 < class'int'> 20 1 • statements access for free at openstax. org 3. what is the type of the following value? " 12. 0 " a. string b. int c. float basic arithmetic arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication, and division. four basi... | openstax_introduction_to_python_programming_-_web | [
0.010568021796643734,
-0.01510187890380621,
0.003589588450267911,
-0.027769140899181366,
-0.016216175630688667,
-0.014809896238148212,
0.028045088052749634,
0.0002938641991931945,
-0.02623300813138485,
0.08524706214666367,
-0.012697016820311546,
0.03330918401479721,
-0.004287396091967821,
... |
3. 0 operator precedence when a calculation has multiple operators, each operator is evaluated in order of precedence. ex : 1 + 2 * 3 is 7 because multiplication takes precedence over addition. however, ( 1 + 2 ) * 3 is 9 because parentheses take precedence over multiplication. operator description example result ( ) p... | openstax_introduction_to_python_programming_-_web | [
0.0003984748327638954,
-0.02934676595032215,
-0.032472338527441025,
-0.039531830698251724,
-0.005370104685425758,
-0.005028110928833485,
0.018784530460834503,
0.019981486722826958,
-0.04606925696134567,
0.04744371771812439,
-0.0004462958313524723,
0.037955936044454575,
-0.020987628027796745,... |
of each of the three variables along with their type. access multimedia content ( https : / / openstax. org / books / introduction - python - programming / pages / 1 - 5 - number - basics ) try it meters to feet write a python computer program that : 1. assigns the integer value 10 to a variable, meters. 2. assigns the... | openstax_introduction_to_python_programming_-_web | [
0.04445969685912132,
0.03842974826693535,
0.00362349022179842,
-0.056107714772224426,
-0.03308117017149925,
0.02420833148062229,
0.061970923095941544,
0.013494113460183144,
-0.0035119992680847645,
0.06101979315280914,
0.03856869786977768,
0.0057142688892781734,
-0.004430487751960754,
-0.05... |
1. 6 error messages learning objectives by the end of this section you should be able to • identify the error type and line number in error messages. • correct syntax errors, name errors, and indentation errors. how to read errors a natural part of programming is making mistakes. even experienced programmers make mista... | openstax_introduction_to_python_programming_-_web | [
-0.02493862807750702,
-0.01126950979232788,
-0.0035133766941726208,
0.0013780065346509218,
-0.0130988210439682,
-0.013217514380812645,
0.026550116017460823,
-0.0060201967135071754,
-0.007424797862768173,
0.0644885003566742,
-0.004672181326895952,
0.03318477049469948,
0.004277616273611784,
... |
pages / 1 - 6 - error - messages ) 24 1 • statements access for free at openstax. org concepts in practice parts of an error given the following error message : traceback ( most recent call last ) : file " / home / student / desktop / example. py ", line 2 print " test " ^ syntaxerror : missing parentheses in call to'p... | openstax_introduction_to_python_programming_-_web | [
-0.03232165798544884,
-0.03224056959152222,
-0.016236888244748116,
0.004313640296459198,
0.0030239771585911512,
-0.018954329192638397,
0.012956610880792141,
-0.006030501797795296,
0.007997351698577404,
0.059047892689704895,
0.009431256912648678,
0.0276339054107666,
0.0060631753876805305,
-... |
1. 6 • error messages 25 mistake error message explanation prints ( " you typed : ", word ) nameerror : name'prints'is not defined the spelling of print is incorrect. the programmer accidentally typed an extra letter. print ( " hello " ) indentationerror : unexpected indent the programmer accidentally typed a space at ... | openstax_introduction_to_python_programming_-_web | [
-0.005657991394400597,
-0.025586510077118874,
0.02490788884460926,
0.006325968541204929,
0.006789228413254023,
-0.020221075043082237,
0.021189110353589058,
0.0009007233311422169,
0.008318143896758556,
0.0749158039689064,
0.005761073436588049,
0.028740983456373215,
0.007316611707210541,
0.0... |
- 6 - error - messages ) try it wrong symbols this code is based on an earlier example, but the code contains several mistakes. • one line is missing required punctuation, and another line uses incorrect symbols. • run the program to find the first error, and correct the corresponding line of code. • keep running and c... | openstax_introduction_to_python_programming_-_web | [
-0.0009665263933129609,
-0.01641935296356678,
0.014514589682221413,
-0.005361940711736679,
0.0028081771451979876,
-0.004568709060549736,
-0.0008373247692361474,
-0.01040656678378582,
0.0453551709651947,
0.0728662982583046,
-0.01651102304458618,
0.029065776616334915,
0.01725202053785324,
-0... |
1. 7 comments learning objectives by the end of this section you should be able to • write concise, meaningful comments that explain intended functionality of the code. • write a docstring ( more verbose comment ) that describes the program functionality. the hash character comments are short phrases that explain what ... | openstax_introduction_to_python_programming_-_web | [
-0.006934915203601122,
-0.025284048169851303,
-0.0039536734111607075,
-0.04062808305025101,
-0.010008241981267929,
-0.010757353156805038,
0.0535460039973259,
0.01649852842092514,
-0.03188127279281616,
0.0701613649725914,
-0.004326827824115753,
0.06069328263401985,
0.005003139842301607,
-0.... |
1. 7 • comments 27 example 1. 2 program with three comments 1 # display the menu options 2 print ( " lunch menu " ) 3 print ( " - - - - - - - - - - " ) 4 print ( " burrito " ) 5 print ( " enchilada " ) 6 print ( " taco " ) 7 print ( " salad " ) 8 print ( ) # end of menu 9 10 # get the user's preferences 11 item1 = inpu... | openstax_introduction_to_python_programming_-_web | [
0.012662813998758793,
-0.0035189345944672823,
0.008502967655658722,
-0.018557660281658173,
-0.006997900549322367,
-0.0193562563508749,
0.036863457411527634,
0.015348302200436592,
-0.007058611139655113,
0.06522247940301895,
-0.009534010663628578,
0.02444484643638134,
0.0383782722055912,
-0.... |
for the following code? print ( " you said : ", adj1 + " " + noun1 ) a. # append adj1 and noun1 b. # print out a bunch of stuff c. # show the resulting phrase 5. where should a blank line be inserted? 1 name = input ( " whose birthday is today? " ) 2 print ( " happy birthday to ", name ) 3 print ( " everyone cheer for ... | openstax_introduction_to_python_programming_-_web | [
-0.005731071345508099,
-0.04138140007853508,
0.00464347330853343,
-0.003647001925855875,
0.006115893833339214,
-0.03430253639817238,
0.010412612929940224,
-0.012377889826893806,
0.029966380447149277,
0.061815254390239716,
-0.004738388117402792,
-0.0031587372068315744,
0.0051781670190393925,
... |
1. 7 • comments 29 concepts in practice documentation 7. the main purpose of writing docstrings is to... a. summarize the program's purpose or usage. b. explain how each part of the code works. c. maintain a list of ideas for new features. 8. which of the following is not a docstring? a. " " " vacations madlib. " " " b... | openstax_introduction_to_python_programming_-_web | [
0.024126313626766205,
-0.03343490883708,
0.02894793450832367,
-0.004892163444310427,
-0.01045249868184328,
-0.03842826560139656,
0.007377535570412874,
0.004793086554855108,
-0.008785316720604897,
0.05509573221206665,
-0.003616244299337268,
-0.0008856240892782807,
0.024332867935299873,
-0.0... |
org / books / introduction - python - programming / pages / 1 - 7 - comments ) try it gravity calculation write a docstring for the following program. the first line of the docstring should explain, in one short 30 1 • statements access for free at openstax. org sentence, what the program is. the second line of the doc... | openstax_introduction_to_python_programming_-_web | [
0.015621764585375786,
-0.011143263429403305,
-0.010652771219611168,
-0.015120181255042553,
0.008587455376982689,
-0.024106385186314583,
0.007415407337248325,
0.025193482637405396,
-0.009681730531156063,
0.055751651525497437,
0.029145995154976845,
0.018349040299654007,
0.0181009229272604,
-... |
1. 8 why python? learning objectives by the end of this section you should be able to • name two historical facts about how python was first created. • describe two ways python is considered a popular language. historical background python has an interesting history. in 1982, guido van rossum ( https : / / openstax. or... | openstax_introduction_to_python_programming_-_web | [
0.054940301924943924,
-0.02058759331703186,
0.0008972499636001885,
-0.0609084852039814,
0.01927994377911091,
0.000002821695034072036,
-0.021124310791492462,
-0.00485024182125926,
-0.021512312814593315,
0.021992001682519913,
-0.0004621313710231334,
-0.015283825807273388,
0.014140906743705273,... |
yet advanced, suitable for everyday tasks, and freely available online contributed to python's long - term success. checkpoint key decisions access multimedia content ( https : / / openstax. org / books / introduction - python - programming / pages / 1 - 8 - why - python ) concepts in practice python history 1. the pyt... | openstax_introduction_to_python_programming_-_web | [
0.06651273369789124,
-0.0025519970804452896,
-0.03436741232872009,
-0.007771065924316645,
-0.005372742656618357,
0.03206479921936989,
-0.022068766877055168,
-0.021024633198976517,
0.018340013921260834,
0.04782155528664589,
-0.007610262371599674,
0.0018550107488408685,
0.005259206518530846,
... |
1. 8 • why python? 31 a. british comedy group b. dutch programmer c. non - venomous snake 2. which programming language came first? a. java b. python 3. which sentence best describes the beginning of python? a. cwi hired guido van rossum to design a new programming language to compete with c + +. b. python started out ... | openstax_introduction_to_python_programming_-_web | [
0.05102264881134033,
-0.022361351177096367,
-0.031076176092028618,
-0.04080142080783844,
-0.0029634973034262657,
-0.00914428848773241,
-0.02025008760392666,
-0.003407798008993268,
-0.00588777381926775,
0.023156071081757545,
-0.026824520900845528,
0.02318144589662552,
-0.0004802269977517426,
... |
. no other language but c and java had been # 1 for the previous 20 years. another way to see python's popularity is to analyze how frequently python is discussed online. stack overflow ( https : / / openstax. org / r / 100overflow ) is a question - and - answer website for programmers. figure 1. 3 shows the number of ... | openstax_introduction_to_python_programming_-_web | [
0.05354417487978935,
-0.0052182297222316265,
-0.008505317382514477,
0.014660823158919811,
-0.00042637414298951626,
0.010855610482394695,
-0.0013911915011703968,
0.0024812137708067894,
0.007192237768322229,
0.022804923355579376,
-0.045648954808712006,
0.022602008655667305,
-0.0087073966860771... |
1. 9 chapter summary this chapter introduced the basics of programming in python, including : • print ( ) and input ( ). • variables and assignment. • strings, integers, and floats. • arithmetic, concatenation. • common error messages. • comments and docstrings. at this point, you should be able to write programs that ... | openstax_introduction_to_python_programming_-_web | [
0.008336870931088924,
-0.016065578907728195,
0.017279382795095444,
-0.010019171051681042,
-0.013048935681581497,
-0.030501272529363632,
0.022696444764733315,
-0.011013432405889034,
-0.012836177833378315,
0.0591522753238678,
0.009182386100292206,
0.009154991246759892,
-0.003693776670843363,
... |
represent the same string. by convention, this book uses double quotes ( " ) for most strings. " " " ( docstring ) used for documentation, often in multi - line strings, to summarize a program's purpose or usage. table 1. 6 chapter 1 reference. try it fun facts write a program that assigns a variable named number to an... | openstax_introduction_to_python_programming_-_web | [
0.019628304988145828,
-0.04368673264980316,
0.036799658089876175,
-0.01612890139222145,
-0.04797437787055969,
-0.0478169210255146,
0.059171613305807114,
-0.006270099431276321,
-0.005147505551576614,
0.050015710294246674,
0.05253252014517784,
-0.0034353905357420444,
-0.004144835751503706,
-... |
1. 9 • chapter summary 35 74 plus 123 is 197 74 minus 456 is - 382 run the program multiple times, using a different integer each time. your output should be mathematically correct for any integer that you choose. the point of this exercise is to perform basic arithmetic within a print statement. do not use any other v... | openstax_introduction_to_python_programming_-_web | [
0.028437752276659012,
-0.020241398364305496,
0.03500409424304962,
-0.02665170468389988,
-0.023738401010632515,
-0.03145124763250351,
0.003685475094243884,
-0.0027385102584958076,
-0.016526712104678154,
0.04691367223858833,
0.003347791964188218,
0.009974678978323936,
0.02225775457918644,
-0... |
an field. notice that the first line should be completely blank. replace the bold words ( from the above example ) with the actual words input by the user. your final program should have four input statements, three print statements, and at least two comments. 36 1 • statements access for free at openstax. org for comp... | openstax_introduction_to_python_programming_-_web | [
-0.011394494213163853,
-0.042810145765542984,
0.021463114768266678,
-0.022773530334234238,
-0.015179882757365704,
-0.02762027643620968,
0.02705354057252407,
-0.006876667495816946,
0.01146763563156128,
0.06393641978502274,
0.00359496776945889,
0.05297276750206947,
0.02396553009748459,
-0.01... |
2. 9 chapter summary introduction a computer program is a sequence of statements that run one after the other. in python, many statements consist of one or more expressions. an expression represents a single value to be computed. ex : the expression 3 * x - 5 evaluates to 7 when x is 4. learning to recognize expression... | openstax_introduction_to_python_programming_-_web | [
0.013612388633191586,
-0.00011156628897879273,
0.021709388121962547,
-0.006951554212719202,
0.01398969441652298,
-0.0348927304148674,
0.041784413158893585,
-0.0018919412977993488,
-0.035313550382852554,
0.07265746593475342,
0.0008986276807263494,
0.03678279370069504,
0.010077388025820255,
... |
2. 1 the python shell learning objectives by the end of this section you should be able to • use a python shell to run statements and expressions interactively. • explain the function of the up and down arrow keyboard shortcuts. the interpreter python is a high - level language, meaning that the source code is intended... | openstax_introduction_to_python_programming_-_web | [
0.00735856220126152,
0.00030550576047971845,
-0.016245968639850616,
-0.007707938086241484,
0.0020077007357031107,
-0.007865268737077713,
-0.023525692522525787,
0.009664269164204597,
-0.025423426181077957,
0.04626690223813057,
-0.006501245312392712,
0.02623147889971733,
-0.021870220080018044,... |
keys a python shell is convenient for exploring and troubleshooting code. the user can try something, look at the 40 2 • expressions access for free at openstax. org results, and then try something else. when an error occurs, an error message is displayed, but the program keeps running. that way, the user can edit the ... | openstax_introduction_to_python_programming_-_web | [
0.02409357950091362,
0.004724590107798576,
-0.001052422565408051,
-0.017362378537654877,
-0.00835367664694786,
-0.02311006747186184,
-0.024506239220499992,
-0.005316147115081549,
0.021802157163619995,
0.1026621013879776,
0.0040953559800982475,
0.021383635699748993,
-0.006200115196406841,
0... |
a time, to see the result. here are a few expressions to try : • x = 5 • 3 * x - 5 • 3 * ( x - 5 ) • x • type ( 1 ) • type ('1') | openstax_introduction_to_python_programming_-_web | [
0.02681110054254532,
0.001167906797491014,
0.0214221328496933,
0.005813919939100742,
0.0090488838031888,
-0.04795800894498825,
0.016134710982441902,
0.02661353349685669,
-0.01089529599994421,
0.0706743374466896,
0.05811798572540283,
0.03031277284026146,
-0.01334319170564413,
-0.02833271585... |
2. 1 • the python shell 41 • str ( 1 ) • int ('1') • abs ( - 5 ) • abs ( 5 ) • len ( " yo " ) • len ( " hoho " ) • round ( 9. 49 ) • round ( 9. 50 ) note : these functions ( type, str, int, len, and round ) will be explored in more detail later in the chapter. you can read more about the built - in functions ( https : ... | openstax_introduction_to_python_programming_-_web | [
0.010278207249939442,
0.011423828080296516,
0.03812294825911522,
-0.01515183225274086,
-0.024995945394039154,
0.00007366840145550668,
0.04104389622807503,
0.015923310071229935,
0.008307551965117455,
0.07311219722032547,
0.04999391734600067,
0.030211543664336205,
-0.0002276882150908932,
0.0... |
2. 2 type conversion learning objectives by the end of this section you should be able to • explain how the interpreter uses implicit type conversion. • use explicit type conversion with int ( ), float ( ), and str ( ). 42 2 • expressions access for free at openstax. org implicit type conversion common operations updat... | openstax_introduction_to_python_programming_-_web | [
0.0025197844952344894,
0.024187050759792328,
0.011046024039387703,
-0.01618523709475994,
-0.047092046588659286,
-0.024698497727513313,
0.024975651875138283,
-0.02032051421701908,
-0.004133307375013828,
0.08788111805915833,
0.025433072820305824,
0.02772831730544567,
-0.00799524411559105,
-0... |
. ex : float ( 2 ) produces 2. 0. • str ( ) converts a data type to a string. ex : str ( 3. 14 ) produces " 3. 14 ". | openstax_introduction_to_python_programming_-_web | [
-0.032833367586135864,
-0.014331672340631485,
0.022331733256578445,
-0.02225164882838726,
-0.027394503355026245,
-0.038230977952480316,
0.04033832252025604,
0.007639882154762745,
0.020145118236541748,
0.06647955626249313,
0.01400090754032135,
-0.021367495879530907,
-0.0039037177339196205,
... |
2. 2 • type conversion 43 checkpoint example : ordering pizza access multimedia content ( https : / / openstax. org / books / introduction - python - programming / pages / 2 - 2 - type - conversion ) concepts in practice example : ordering pizza consider the example above. 4. which function converts the input number of... | openstax_introduction_to_python_programming_-_web | [
0.02312566712498665,
-0.007653182838112116,
0.012415350414812565,
-0.023235462605953217,
-0.08188280463218689,
-0.041699204593896866,
0.01898883283138275,
0.027974532917141914,
0.002282526344060898,
0.06570954620838165,
0.016986114904284477,
0.008326013572514057,
0.007911217398941517,
0.02... |
4. 5 try it grade average the following program computes the average of three predefined exam grades and prints the average twice. improve the program to read the three grades from input and print the average first as a float, and 44 2 • expressions access for free at openstax. org then as an integer, using explicit ty... | openstax_introduction_to_python_programming_-_web | [
-0.015344265848398209,
0.0021511411760002375,
0.004944365005940199,
-0.03106066770851612,
-0.032356731593608856,
-0.008127176202833652,
0.03833646699786186,
0.0030332698952406645,
0.01188395544886589,
0.06798143684864044,
0.01916969195008278,
0.0014762456994503736,
0.01491924375295639,
-0.... |
to combine numbers of different data types. ex : a program computes the total for an online shopping order : quantity = int ( input ( ) ) price = float ( input ( ) ) total = quantity * price print ( total ) quantity is an integer, and price is a float. so what is the data type of total? for input 3 and 5. 0, total is 2... | openstax_introduction_to_python_programming_-_web | [
-0.020666468888521194,
-0.018161742016673088,
0.0010805774945765734,
-0.025530362501740456,
-0.027424892410635948,
-0.05343532934784889,
0.061097320169210434,
-0.0017009276198223233,
0.025505175814032555,
0.06321887671947479,
-0.00011633185931714252,
0.018305890262126923,
-0.0115293171256780... |
4. 75 combining numeric types and strings easy type conversion in python can lead a programmer to assume that any data type can be combined with another. ex : noor's program reads in a number from input and uses the number in a calculation. this results in 46 2 • expressions access for free at openstax. org an error in... | openstax_introduction_to_python_programming_-_web | [
-0.00022141015506349504,
-0.013606059364974499,
-0.0047289179638028145,
-0.023106371983885765,
-0.03492946922779083,
-0.043537575751543045,
0.020102892071008682,
0.012358888983726501,
0.00798196904361248,
0.08452798426151276,
0.005874952767044306,
0.007440065965056419,
0.010017885826528072,
... |
2. 3 • mixed data types 47 a.'this'b.'thisthis'c. error try it after the point write a program that reads in a string of digits that represents the digits after the decimal point of a number, num. concatenate the input string together with '.'and num, and print the result. ex : if input is 345, the program will print 2... | openstax_introduction_to_python_programming_-_web | [
0.0031939910259097815,
-0.0009846159955486655,
-0.00032257038401439786,
0.0004155792121309787,
-0.010015195235610008,
-0.03875414654612541,
0.01879241317510605,
0.003080348251387477,
0.05638132244348526,
0.07578477263450623,
-0.005818061996251345,
0.01220522541552782,
0.02206648513674736,
... |
2. 4 floating - point errors learning objectives by the end of this section you should be able to • explain numerical inaccuracies related to floating - point representation. • use the round ( ) function to mitigate floating - point errors in output. floating - point errors computers store information using 0's and 1's... | openstax_introduction_to_python_programming_-_web | [
-0.010496137663722038,
0.000491532904561609,
0.01343538984656334,
-0.022831760346889496,
-0.026558157056570053,
-0.02585024945437908,
0.04184658080339432,
-0.014200498349964619,
-0.0011157516855746508,
0.08300492912530899,
0.0026804443914443254,
-0.00930548831820488,
-0.006090197246521711,
... |
0. 400000000000000022204460492503 table 2. 1 round - off error. ( the example above shows a formatted string or f - string, which are introduced in the objects chapter. ) an overflow error occurs when a value is too large to be stored. the maximum and minimum floating - point values that can be represented are and, res... | openstax_introduction_to_python_programming_-_web | [
-0.019905811175704002,
-0.02600354515016079,
0.04599936679005623,
0.008261991664767265,
-0.02742023952305317,
-0.03923628106713295,
0.0807788297533989,
-0.003429142292588949,
0.004914911929517984,
0.07680141925811768,
0.01760939694941044,
0.020807968452572823,
0.026209982112050056,
0.00563... |
3. 0 to the power of 1024 = traceback ( most recent call last ) : file " < stdin > ", line 3, in < module > print ('3. 0 to the power of 1024 = ', 3. 0 * * 1024 ) overflowerror : ( 34,'numerical result out of range') table 2. 2 overflow error. concepts in practice floating - point errors for each situation, which error... | openstax_introduction_to_python_programming_-_web | [
-0.0068002548068761826,
-0.04545888304710388,
0.036775216460227966,
-0.005704048089683056,
-0.022920234128832817,
-0.02086787298321724,
0.06102791428565979,
-0.011102930642664433,
0.02153957076370716,
0.047711268067359924,
0.018610835075378418,
0.02317991480231285,
0.0005150920478627086,
-... |
2. 4 • floating - point errors 49 floating point round ( ) function python's round ( ) function is used to round a floating - point number to a given number of decimal places. the function requires two arguments. the first argument is the number to be rounded. the second argument decides the number of decimal places to... | openstax_introduction_to_python_programming_-_web | [
0.00038766502984799445,
0.0021977152209728956,
-0.0005094704683870077,
-0.009906441904604435,
-0.04618586599826813,
-0.0078064086847007275,
0.018122263252735138,
0.003430121811106801,
-0.008469455875456333,
0.07872781902551651,
0.026678232476115227,
-0.0027667167596518993,
-0.016698099672794... |
0. 1000000000000000055511151231257827021181583404541015625 try it inaccurate tips the following code calculates the tip amount, given a bill amount and the tip ratio. experiment with the 50 2 • expressions access for free at openstax. org following bill amounts and tip ratios and see if any inaccuracies may result in c... | openstax_introduction_to_python_programming_-_web | [
0.013351840898394585,
0.05256812646985054,
-0.008877663873136044,
-0.004288077354431152,
-0.03287208080291748,
-0.027474697679281235,
0.03338299319148064,
0.02301069349050522,
0.0007426566444337368,
0.05776191130280495,
0.04910728707909584,
-0.006953262723982334,
-0.023500412702560425,
0.0... |
2. 5 dividing integers learning objectives by the end of this section you should be able to • evaluate expressions that involve floor division and modulo. • use the modulo operator to convert between units of measure. division and modulo python provides two ways to divide numbers : • true division ( / ) converts number... | openstax_introduction_to_python_programming_-_web | [
0.03314850106835365,
-0.020365647971630096,
-0.053006064146757126,
-0.03675176575779915,
-0.020137211307883263,
-0.020123330876231194,
0.02481049858033657,
-0.0033307536505162716,
-0.025845810770988464,
0.08365938812494278,
-0.02419249527156353,
-0.00493272952735424,
0.011446090415120125,
... |
0. 25 c. 1 4. 2 % 0 a. 0 b. 2 c. error unit conversions division is useful for converting one unit of measure to another. to convert centimeters to meters, a variable is divided by 100. ex : 300 centimeters divided by 100 is 3 meters. amounts often do not divide evenly as integers. 193 centimeters is 1. 93 meters, or 1... | openstax_introduction_to_python_programming_-_web | [
0.01981893926858902,
0.016688477247953415,
-0.016173459589481354,
-0.026583120226860046,
-0.020371733233332634,
0.02102758176624775,
0.034215062856674194,
0.010017587803304195,
0.0012769863242283463,
0.08241977542638779,
0.010978136211633682,
0.008567193523049355,
-0.02161453478038311,
-0.... |
and ( 3 ) outputs the results in hours and minutes. your program should use the following prompts ( user input in bold ) : 13 current minute ( 0 - 59 )? 25 trip time ( in minutes )? 340 current hour ( 0 - 23 )? 13 current minute ( 0 - 59 )? 25 trip time ( in minutes )? 340 in this example, the current time is 13 : 25 (... | openstax_introduction_to_python_programming_-_web | [
0.01863867975771427,
0.0376923643052578,
0.02198643609881401,
-0.013864167034626007,
0.014101737178862095,
0.000337586592650041,
0.008010424673557281,
0.008374973200261593,
0.001617552014067769,
0.09426113218069077,
0.011432765983045101,
-0.005809035152196884,
-0.010896607302129269,
-0.014... |
bold ) : | openstax_introduction_to_python_programming_-_web | [
0.01221542526036501,
-0.016851112246513367,
0.010097450576722622,
0.043191272765398026,
-0.013225366361439228,
-0.004913442302495241,
0.03289436921477318,
0.00677631888538599,
0.0450919046998024,
0.006006269715726376,
0.04257472604513168,
0.018867414444684982,
0.015753459185361862,
-0.0119... |
18. 76 cash payment? 20 total amount? 18. 76 cash payment? 20 you may assume that the cash paid will always be a whole number ( representing dollar bills ) that is greater than or equal to the total amount. the program should calculate and output the amount of change due and how many dollars, quarters, dimes, nickels, ... | openstax_introduction_to_python_programming_-_web | [
0.006068527698516846,
0.02347404509782791,
-0.005622358061373234,
0.0020179615821689367,
-0.04286213591694832,
-0.011517491191625595,
0.015098591335117817,
-0.01558856200426817,
-0.010615559294819832,
0.09168583154678345,
0.02578122913837433,
0.010083330795168877,
-0.0013291304931044579,
0... |
2. 6 the math module learning objectives by the end of this section you should be able to 54 2 • expressions access for free at openstax. org • distinguish between built - in functions and math functions. • use functions and constants defined in the math module. importing modules python comes with an extensive standard... | openstax_introduction_to_python_programming_-_web | [
0.031635623425245285,
0.03566480055451393,
0.0003994279832113534,
-0.01164769846946001,
-0.020818481221795082,
0.05234501138329506,
-0.001553898910060525,
-0.0016280228737741709,
-0.03529684990644455,
0.07898730784654617,
0.02128853090107441,
0.053604334592819214,
0.010716309770941734,
-0.... |
##2 - x1 ) * * 2 + ( y2 - y1 ) * * 2 ) print ( " the distance is ", distance ) checkpoint importing math in a python shell access multimedia content ( https : / / openstax. org / books / introduction - python - programming / pages / 2 - 6 - the - math - module ) concepts in practice built - in functions and math module... | openstax_introduction_to_python_programming_-_web | [
0.05079992860555649,
0.009509812109172344,
-0.0018669029232114553,
0.008964774198830128,
-0.008327887393534184,
0.013417677953839302,
-0.025876589119434357,
-0.0004089021822437644,
-0.014915096573531628,
0.095187708735466,
0.02614993043243885,
0.028411012142896652,
0.03896341845393181,
-0.... |
2. 6 • the math module 55 b. the variable pie was spelled incorrectly. c. the math module was not imported. 2. which of these functions is builtin and does not need to be imported? a. log ( ) b. round ( ) c. sqrt ( ) 3. which expression results in an error? a. math. abs ( 1 ) b. math. log ( 1 ) c. math. sqrt ( 1 ) math... | openstax_introduction_to_python_programming_-_web | [
0.045550618320703506,
0.0072957370430231094,
0.012644689530134201,
-0.0065236762166023254,
-0.029514528810977936,
0.0049299090169370174,
0.006074429955333471,
0.009887658059597015,
-0.029195699840784073,
0.07764281332492828,
0.05578041449189186,
0.052622437477111816,
0.0016546844271942973,
... |
x, base ) the logarithm of x to the given base. math. log ( 8, 2 ) 3. 0 math. log ( 10000, 10 ) 4. 0 math. pow ( x, y ) x raised to the power y. unlike the * * operator, math. pow ( ) converts x and y to type float. math. pow ( 3, 0 ) 1. 0 math. pow ( 3, 3 ) 27. 0 math. sqrt ( x ) the square root of x. math. sqrt ( 9 )... | openstax_introduction_to_python_programming_-_web | [
0.03353557363152504,
0.019739117473363876,
0.0398721881210804,
-0.041160982102155685,
-0.02341601811349392,
0.004286790266633034,
0.00042875492363236845,
-0.009458447806537151,
-0.009226983413100243,
0.06875307857990265,
0.0387657955288887,
0.033385019749403,
-0.016116492450237274,
-0.0074... |
. math. pi * r * 2 7. which expression returns the integer 27? a. 3 * * 3 b. | openstax_introduction_to_python_programming_-_web | [
0.035228464752435684,
-0.025873012840747833,
0.005867170635610819,
-0.05876721069216728,
-0.019148748368024826,
-0.029769446700811386,
0.0013523285742849112,
0.029031869024038315,
-0.005573839880526066,
0.05724690109491348,
0.04691820591688156,
0.0137421740218997,
-0.05201681703329086,
-0.... |
3. 0 * * 3 c. math. pow ( 3, 3 ) try it quadratic formula in algebra, a quadratic equation is written as. the coefficients a, b, and c are known values. the variable x represents an unknown value. ex : has the coefficients,, and. the quadratic formula provides a quick and easy way to solve a quadratic equation for x : ... | openstax_introduction_to_python_programming_-_web | [
0.017349062487483025,
0.003445745212957263,
0.026999879628419876,
0.00152134511154145,
0.012860462069511414,
0.01686965301632881,
0.06476433575153351,
0.007839413359761238,
-0.022595539689064026,
0.06652708351612091,
0.0536455363035202,
0.04334598779678345,
-0.031874097883701324,
-0.031008... |
0. 5 - 1. 0 table 2. 5 58 2 • expressions access for free at openstax. org provided input expected output 0 1 1 division by zero 1 0 1 math domain error table 2. 5 access multimedia content ( https : / / openstax. org / books / introduction - python - programming / pages / 2 - 6 - the - math - module ) try it cylinder ... | openstax_introduction_to_python_programming_-_web | [
0.007971933111548424,
0.008640925399959087,
0.032249949872493744,
-0.009772174060344696,
-0.029225317761301994,
-0.007080367766320705,
0.01630084402859211,
0.0018215959426015615,
-0.011034904047846794,
0.0605907067656517,
0.03412587568163872,
0.01790851540863514,
-0.04179062694311142,
0.01... |
2. 7 formatting code learning objectives by the end of this section you should be able to • identify good spacing for expressions and statements. • write multi - line statements using implicit line joining. recommended spacing most spaces in python code are ignored when running programs ; however, spaces at the start o... | openstax_introduction_to_python_programming_-_web | [
0.018270673230290413,
0.006611308082938194,
0.02834913320839405,
-0.008182553574442863,
-0.027168506756424904,
-0.043414972722530365,
0.05433451756834984,
0.015726367011666298,
-0.03316943719983101,
0.055393338203430176,
0.015971852466464043,
0.022636985406279564,
-0.03968678042292595,
-0.... |
example common mistakes parentheses : no space before or after. print ( " go team! " ) print ( " go team! " ) print ( " go team! " ) commas : no space before, one space after. print ( " hello ", name ) print ( " hello ", name ) print ( " hello ", name ) assignment : one space before and after the =. name = input ( " yo... | openstax_introduction_to_python_programming_-_web | [
0.011087938211858273,
-0.02445712499320507,
0.02311975322663784,
-0.013041585683822632,
-0.015250420197844505,
-0.04061422124505043,
0.03338594362139702,
0.008256958797574043,
-0.02712683379650116,
0.043990608304739,
0.032142892479896545,
0.03662382438778877,
-0.029027238488197327,
-0.0332... |
2. 7 • formatting code 61 a. b * * 2 - 4 * a * c b. b * * 2 - 4 * a * c c. b * * 2 - 4 * a * c automatic concatenation long strings make python programs difficult to read. ex : this program prints the first sentence of the us declaration of independence ( https : / / openstax. org / r / 100declaration ) : print ( " the... | openstax_introduction_to_python_programming_-_web | [
-0.001970528857782483,
-0.0389983169734478,
0.02967286854982376,
0.04308284819126129,
-0.0028211537282913923,
0.0014601333532482386,
0.0484335832297802,
-0.01554113905876875,
-0.0074829356744885445,
0.06897597759962082,
0.010541943833231926,
0.021984342485666275,
-0.010401511564850807,
-0.... |
- programming / pages / 2 - 7 - formatting - code ) concepts in practice string literal concatenation 5. which line prints the word " grandmother "? a. print ( grandmother ) b. print ( " grand " " mother " ) c. print ( " grand ", " mother " ) 6. what string is equivalent to " today is " " a holiday "? 62 2 • expression... | openstax_introduction_to_python_programming_-_web | [
0.021060124039649963,
-0.014451675117015839,
0.00942824874073267,
0.01421043835580349,
-0.015749942511320114,
-0.03173661231994629,
0.0416574589908123,
-0.0064707170240581036,
0.0011214789701625705,
0.051872268319129944,
-0.001778766163624823,
0.002778716152533889,
-0.019251732155680656,
-... |
.. " # next part of string "... " ) b. print the string using multiple print statements. print ( "... " ) # first part of string print ( "... " ) # next part of string print ( "... " ) | openstax_introduction_to_python_programming_-_web | [
0.003649607300758362,
-0.02193363569676876,
0.011257372796535492,
0.007174177095293999,
0.005982992239296436,
-0.06785915791988373,
0.007858428172767162,
-0.02048025093972683,
0.003029643325135112,
0.06104602292180061,
0.012984995730221272,
0.013192216865718365,
-0.0003481503517832607,
-0.... |
2. 7 • formatting code 63 c. assign the string to a variable and print the variable. text = "... " # the entire string print ( text ) 10. which example consists of two statements? a. print ( " happy " " new year " ) b. saying = ( " happy " " new year " ) c. saying = " happy " " new year " try it spaced out the followin... | openstax_introduction_to_python_programming_-_web | [
0.01742364466190338,
-0.03321297466754913,
0.03293424844741821,
-0.003914778120815754,
-0.03484325110912323,
-0.037413157522678375,
0.024185843765735626,
0.005612627603113651,
-0.006002373993396759,
0.07149453461170197,
0.009679029695689678,
0.02943645603954792,
0.0037462476175278425,
-0.0... |
clearly will be of tremendous value. " 4. " now, it's my belief that python is a lot easier than to teach to students programming and teach them c or c + + or java at the same time because all the details of the languages are so much harder. other scripting languages really don't work very well there either. " 64 2 • e... | openstax_introduction_to_python_programming_-_web | [
0.03063347004354,
0.00860829558223486,
0.001084967632777989,
0.01391755323857069,
-0.042229440063238144,
-0.0034957868047058582,
0.018613694235682487,
0.01502076257020235,
-0.012141766957938671,
0.07355593144893646,
0.01595471054315567,
0.026602009311318398,
0.0014933607308194041,
-0.03705... |
2. 8 python careers learning objectives by the end of this section you should be able to • summarize how python is used in fields other than cs and it. • describe two different kinds of applications made with python. fields and applications learning python opens the door to many programming - related careers. example j... | openstax_introduction_to_python_programming_-_web | [
0.02049781195819378,
-0.009513631463050842,
-0.03378680348396301,
-0.03520950302481651,
-0.0088850362226367,
-0.0038904352113604546,
0.0036462517455220222,
-0.007216729689389467,
-0.006503423675894737,
0.06671566516160965,
0.011153683066368103,
0.00973657425493002,
0.05306142941117287,
-0.... |
2. 8 • python careers 65 application example use of python artificial intelligence an engineer develops models to support image and voice recognition. ex : tensorflow library ( https : / / openstax. org / r / 100tensorflow ). data visualization a statistician creates charts to make sense of large amounts of data. ex : ... | openstax_introduction_to_python_programming_-_web | [
0.039561621844768524,
0.008345545269548893,
-0.029086297377943993,
-0.040868937969207764,
-0.017477717250585556,
-0.0017288969829678535,
-0.0030364422127604485,
0.002944055013358593,
0.01714605838060379,
0.07318278402090073,
0.004800379741936922,
-0.002051989547908306,
0.0451258048415184,
... |
for free at openstax. org | openstax_introduction_to_python_programming_-_web | [
-0.035601306706666946,
0.04145768657326698,
-0.005269367713481188,
0.03497558459639549,
-0.03743794560432434,
-0.03236481547355652,
-0.0012958046281710267,
0.004353965632617474,
0.016338679939508438,
0.047161318361759186,
0.046532534062862396,
0.034051768481731415,
0.013303137384355068,
-0... |
2. 9 chapter summary highlights from this chapter include : • expressions and statements can be run interactively using a shell. • input strings can be converted to other types. ex : int ( input ( ) ). • strings can be concatenated with other types. ex : " $ " + str ( cost ). • floats are subject to round - off and ove... | openstax_introduction_to_python_programming_-_web | [
-0.012727920897305012,
-0.0037980196066200733,
0.024105669930577278,
-0.02913270890712738,
-0.030140148475766182,
-0.03734961897134781,
0.014310073107481003,
0.009574591182172298,
0.006743678357452154,
0.08601482212543488,
0.005859028548002243,
0.020417463034391403,
-0.011070325039327145,
... |
2. 9 • chapter summary 67 try it baking bread the holidays are approaching, and you need to buy ingredients for baking many loaves of bread. according to a recipe by king arthur flour ( https : / / openstax. org / r / 100kingarthurflr ), you will need the following ingredients for each loaf : • 1 1 / 2 teaspoons instan... | openstax_introduction_to_python_programming_-_web | [
0.04537269473075867,
0.052042458206415176,
0.026565896347165108,
-0.024701280519366264,
-0.04112072288990021,
0.0165257565677166,
0.03381171450018883,
-0.008413571864366531,
0.028766758739948273,
0.016953889280557632,
0.044657837599515915,
-0.0582902729511261,
0.014244340360164642,
-0.0527... |
1. 953125 cups lukewarm water in the above output, bread _ weight is 16. 0 ounces, serving _ size is 2. 5 ounces, and num _ guests is 25 people. use these three variables to calculate the number of loaves needed. make sure your output matches the above example exactly. notice that each line of the ingredients begins wi... | openstax_introduction_to_python_programming_-_web | [
0.025146497413516045,
0.04419684782624245,
0.028101960197091103,
-0.00282689300365746,
-0.10033047944307327,
0.03334084525704384,
0.02893119491636753,
0.010945887304842472,
0.0008730021072551608,
0.02724114991724491,
0.04189297929406166,
-0.009641502052545547,
-0.01380095910280943,
-0.0217... |
43. 21 percentage to tip : 18 number of people : 2 enter bill amount : 43. 21 percentage to tip : 18 number of people : 2 then calculate the tip amount and total amount for the bill, based on the user input. output the results using this format : tip amount : $ 7. 78 total amount : $ 50. 99 tip per person : $ 3. 89 tot... | openstax_introduction_to_python_programming_-_web | [
0.004881830420345068,
0.029311738908290863,
-0.018638571724295616,
-0.03010699711740017,
-0.028695128858089447,
-0.03132704272866249,
0.04852611944079399,
0.0016186763532459736,
0.018313609063625336,
0.04390363395214081,
0.017691120505332947,
-0.008669805712997913,
-0.007593091111630201,
0... |
3. 1 strings revisited learning objectives by the end of this section you should be able to • extract a specific character from a string using an index. • use escape sequences to represent special characters. indexes a string is a sequence of zero or more characters. each character has an index that refers to the chara... | openstax_introduction_to_python_programming_-_web | [
-0.006295319646596909,
0.002777537563815713,
0.012400143779814243,
-0.006070575676858425,
-0.013335009105503559,
-0.0129059674218297,
0.026735125109553337,
-0.002066513290628791,
0.0017319710459560156,
0.07470718026161194,
-0.0005021963734179735,
0.01462640892714262,
-0.013203822076320648,
... |
code 72 3 • objects access for free at openstax. org points and supports most of the world's written languages. 32 ( space ) 33! 34 " 35 # 36 $ 37 % 38 & 39'40 ( 41 ) 42 * 43 + 44, 45 - 46. 47 / 48 0 49 1 50 2 51 3 52 4 53 5 54 6 55 7 56 8 57 9 58 : 59 ; 60 < 61 = 62 > 63? 64 @ 65 a 66 b 67 c 68 d 69 e 70 f 71 g 72 h 7... | openstax_introduction_to_python_programming_-_web | [
-0.019286826252937317,
-0.030606674030423164,
0.007990775629878044,
0.011688519269227982,
-0.025632163509726524,
-0.027737213298678398,
0.01673141121864319,
-0.026599453762173653,
-0.009738747030496597,
0.06244393438100815,
0.018640676513314247,
0.06625969707965851,
-0.04286273568868637,
-... |
3. 1 • strings revisited 73 c. 97 5. what value does ord ( " 0 " ) return? a. 0 b. 48 c. error 6. what does chr ( 126 ) return? a. ~ b. " ~ " c. error special characters an escape sequence uses a backslash ( \ ) to represent a special character within a string. escape sequence meaning example screen output \ n a newlin... | openstax_introduction_to_python_programming_-_web | [
-0.0013094462919980288,
-0.008480880409479141,
0.007922823540866375,
0.003618229879066348,
-0.02656080573797226,
-0.0114359175786376,
0.004174226429313421,
0.010457274504005909,
-0.005430399440228939,
0.0637209340929985,
0.005523098632693291,
0.059758301824331284,
-0.019598187878727913,
-0... |
it hopper quote grace hopper ( https : / / openstax. org / r / 100gracehopper ) ( 1906 – 1992 ) was a famous computer scientist ( and rear admiral in the us navy! ) who came up with the idea of machine - independent programming languages. she envisioned a programming language based on english and made many contribution... | openstax_introduction_to_python_programming_-_web | [
0.021343521773815155,
-0.016256332397460938,
0.017235515639185905,
-0.00039292426663450897,
-0.04728740453720093,
-0.014815006405115128,
-0.017958864569664,
0.015924779698252678,
-0.006307629868388176,
0.008223036304116249,
0.013849418610334396,
0.021080467849969864,
0.03601681441068649,
-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.