id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

david.white@denison.edu cs109fall2014 > fun633
prev  |  next  |  chance

Do exercise 6.3.3 in the book. For the algorithm which requires 12n steps you will get five numerical answers. In class we saw that the first was .00000012 and the fourth was .012. For the algorithm which requires n*n steps you should also get five answers. Make a list L of these 10 answers, in numeric form. So the list looks like L = [.00000012,-,-,.012,-,-,-,-,-,-] and you have to fill in the blanks. Copy and paste the following code and use your list L to fill in the blank:

def fun633(k):
  L = [...]
  if k < 15:
    return list2string([k])
  else:
    return list2string(L)

def list2string(L):
    s = ""
    for val in L:
      s += str(val) + ' '
    return s

fun633(1) → '1 '
fun633(2) → '2 '
fun633(3) → '3 '

...Save, Compile, Run (ctrl-enter)

def fun633(k):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy