Skip to content

practical 2: need feedback on nested loop example #26

@EmelineFavreau

Description

@EmelineFavreau

It is an example in Nested loop paragraph:

coffee_drinks <- c("latte", "cappuccino", "espresso", "flat white", "cortado")
coffee_places <- c("Infusion", "Ground", "Sugar Cube", "Foxcroft & Ginger", "Sweet")

for (the_drink in 1:length(coffee_drinks)) {
  for (the_place in 1:length(coffee_places)) {
    print(paste("I'd like a", coffee_drinks[the_drink], "from", coffee_places[the_place]))
  }
}

Does it represent what we wanted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions