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

 

konstans@stuy.edu all > makeHailList
prev  |  next  |  chance

Make a list of the hailstone sequence starting with n and ending with 1. Remember the next number is: 3*n + 1 for odd n's n/2 for even n's 1 is the final element.


makeHailList(1) → [1]
makeHailList(2) → [2, 1]
makeHailList(3) → [3, 10, 5, 16, 8, 4, 2, 1]

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

def makeHailList(n):

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