# How to define an option in k-lang?

To define an option data-type in k-lang, use ? after the data-type.

For example, winner is defined as an optional String here:





 



data Lottery(
	lotteryName:String,
	amount:Int,
	participantList:String*,
	winner:String?,
	status:String
)

Note: This is applicable in all k files, for example while defining any input/output, or a property inside a collection.