Return to Video

Measure Udacity - Intro to Computer Science

  • 0:00 - 0:04
    [Evans] For this quiz, which is an especially udacious one,
  • 0:04 - 0:07
    your goal is to define a procedure, named measure_udacity,
  • 0:07 - 0:10
    that takes as its input a list of strings
  • 0:10 - 0:15
    and outputs a number that is a count of the number of elements in the input list
  • 0:15 - 0:19
    that start with the letter U, where U has to be upper case
  • 0:19 - 0:23
    since lower case Us are not quite udacious enough for us.
  • 0:23 - 0:28
    For example, if we evaluated measure_udacity passing in as input
  • 0:28 - 0:32
    the list containing the strings Dave, Sebastian, and Katy,
  • 0:32 - 0:35
    the result would unfortunately be a 0
  • 0:35 - 0:39
    since none of those strings start with an upper case U.
  • 0:39 - 0:43
    If we instead passed in the list containing the strings Umika and Umberto,
  • 0:43 - 0:50
    the result would be 2 since we have 2 strings that both start with the capital letter U.
  • 0:50 - 0:53
    See if you can define the procedure measure_udacity.
  • 0:53 - 0:56
    I can't claim that this will be a really useful procedure,
  • 0:56 - 0:59
    but it will be a good test of whether you understand how to use a for-loop
  • 0:59 - 1:02
    to go through the elements of a list.
Title:
Measure Udacity - Intro to Computer Science
Description:

more » « less
Video Language:
English
Team:
Udacity
Project:
CS101 - Intro to Computer Science
Duration:
01:03
Udacity Robot edited English subtitles for 11-38 Measure Udacity
Udacity Robot edited English subtitles for 11-38 Measure Udacity
Fran Ontanaya edited English subtitles for 11-38 Measure Udacity
Udacity Robot edited English subtitles for 11-38 Measure Udacity
Udacity Robot edited English subtitles for 11-38 Measure Udacity
Amara Bot added a translation

English subtitles

Revisions Compare revisions