I do! I know it says high school but I lied :)
Answer:
The solution code is written in Python:
- def nested_list_string(list2D):
- output = ""
- for i in range(0, len(list2D)):
- for j in range(0, len(list2D[i])):
- output += str(list2D[i][j]) + " "
-
- return output
Explanation:
Let's create a function and name it as nested_list_string() with one input parameter, list2D (Line 1).
Since our expected final output is a string of number and therefore we define a variable, <em>output</em>, to hold the string (Line 2).
Next use two for loops to traverse every number in the list and convert each of the number to string using <em>str()</em> method. Join each of individual string number to the output (Line 3-5).
At the end, we return the output (Line 7)
Answer:
INPUT "What is the amount of rupees you want converted into paisa"; rupees
paisa = rupees*100
PRINT paisa
Explanation:
done in QBASIC
the semicolon in the 1st line makes the question have a ? at the end. the rupees key word in the 1st line saves the input as a variable
then the second line multiplies by 100 since there are 100 paisa in 1 rupee