Getting Input
Part of the Fundamentals section of Coddy's GDScript journey. Lesson 39 of 92.
Challenge
EasyAfter the welcome message, read two numbers from the input, in this order:
- the bill amount
- the tip percentage
Cast both to float and store them in the variables bill_amount and tip_percentage.
Keep the print() line from the previous step. The program does not print anything new yet, so its output is still:
Bill Split CalculatorTry it yourself
extends Node
func _ready():
print("Bill Split Calculator")
All lessons in Fundamentals
4Operators Part 1
Arithmetic OperatorsInteger DivisionModulo OperatorArithmetic ShortcutsRecap - Simple MathComparison Operators10Functions
Declare a FunctionArgumentsReturnReturn TypesRecap - Sigma FunctionRecap - Validation FunctionDefault Values5Operators Part 2
Logical Operators Part 1Logical Operators Part 2Recap - Simple LogicLogical Operators Part 3Ternary Operator8Bill Split Calculator
Welcome MessageGetting InputPractice on your own: Online GDScript compiler