# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
d = [('red', 1), ('blue', 2), ('green', 3)]

for value in d: 
    word = value[0]
    value = value[1]
    print(word, value)
# -







# ### Task given to student XY

# #### StackOverflow Comment:
#
# We had a task given by our professor:
#
# The task is to ask for an input from the user 
# (specifically the number of times the word will be printed out) 
# and then print out the word with repetitions according to the inputed number. 
# The code should use for-loop and a while-loop.
#
# I am looking for a short and simple code.

# ##### For-Loop

# +
first_task = input('How many times would you like to output the word MNEMO?:')

for i in range(int(first_task)):
    print('MNEMO')
# -

# ##### While-Loop

# +
second_task = int(input('How many times would you like to output the word MNEMO?'))

i = 0 

while i< second_task:
    
    print('MNEMO')
    i += 1
    
    
# -

# ##### Of course I didn't post the solution but rather giving him/her tips on how to achieve this output.

:) 











StarcoderdataJupyterScriptsDedupFiltered