Visual illustration of the code challenge: Boucle for #2

Boucle for #2

Utilisation d’une boucle pour construire une chaine de caractères

Coding in the sandbox You must be logged in to access the sandbox.

Données

Tu as à ta disposition 2 variables :

  • symbol, un caractère
  • repeat, un entier

Réponse attendue

Tu dois créer une chaine de caractères qui contient repeat groupes de symbol. Chaque groupe augmentant de 1 à chaque fois. Chaque groupe est séparé du précédent par un tiret.

Par exemple, si symbol vaut * et repeat vaut 3, alors tu dois retourner : *-**-***

Aide : il va falloir imbriquer 2 boucles for.

Solve the challenge

To code this challenge, several possibilities:
- Want to start coding right away? Use the online Sandbox.
- You can also copy/paste a dataset below.

challenge code for resolution via API: STARTER_10

Some resources to help you:
Data and algorithmic logic Methodologies Corrections

Support for resolution

Progress through challenges using our resolution aids: tools, techniques and advice to help you overcome the most complex programming challenges with methodology, confidence and creativity.

Dataset and algorithmic logic

Based on the data and the expected response, use the process to determine the logic to implement.

Show data and progress

Methodologies

Develop a structured approach with our solving guides. Work on specific concepts such as object-oriented programming or unit testing to improve your coding style and progress.

No methodology yet for this challenge, but we are working on it! Follow us to be informed of the release!


Corrections

The corrections allow you to discover certain technical concepts but will also give you a solution to the challenge. Code the challenge yourself before consulting the corrections ;)

No answer yet for this challenge, but we&'re working on it! Follow us to be informed of the release!

Programming concept(s) that can be used to solve this challenge: Chaines de caractères

Keep coding

Other challenges to complete

Intermediate
Données à nettoyer #2

Données à nettoyer #2

Des numéros de téléphone sont cachés dans ces données. Sauras tu faire un peu de nettoyage pour y accéder ?

Hack
Beginner
#3 : L’alliance

#3 : L’alliance

Avec l’aide de ton amie hackeuse Charlotte, tu vas t’infiltrer au vernissage du vilain Jeff Square…

Hack
Beginner
Bug-out Shelter #1 – The Signal

Bug-out Shelter #1 – The Signal

A signal appears every day... You must analyze it and decrypt it...
Hack Corrigé disponible : Python