STEP 7: We're ready to write our get_user_input function! Let's ask the user for a number of stars.

input() returns the user's input as a string. To use the input as a number, we need to cast it to an integer.

  • In , drag Input an Integer indented inside get_user_input().
  • Change "How old are you?" to "How many stars should there be?".
  • Then, change the variable to the left of the = sign from my_var to number.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)