Menu
CoddyTech

Recap - Product Array

Part of the Fundamentals section of Coddy's GDScript journey. Lesson 66 of 92.

challenge icon

Challenge

Easy

The program reads a count, then that many whole numbers, one per line, and stores them in the array numbers. This part is already written.

Print the product of all the numbers in numbers: every number multiplied together. For the input below, the output is 6, because 1 * 2 * 3 is 6.

3
1
2
3

Try it yourself

extends Node

func _ready():
	var count := int(OS.read_string_from_stdin())
	var numbers := []
	for i in range(count):
		numbers.append(int(OS.read_string_from_stdin()))
	# Write your code below

All lessons in Fundamentals

Practice on your own: Online GDScript compiler