DEV Community

AllenZhu
AllenZhu

Posted on โ€ข Edited on

F# For Dummys - Day 4 Value

Today we learn how to define and store a value

there are different types of value, we introduce 4 of them

  • bool is data type indicate yes or no Image description
let is_this_apple: bool = true
let is_this_orange: bool = false
Enter fullscreen mode Exit fullscreen mode

: bool is type hint, tell compiler type of the variable we define is bool, normally we omit the type hint, as compiler is smart enough to infer the type itself, so we can also define as below

let is_this_apple = true
let is_this_orange = false
Enter fullscreen mode Exit fullscreen mode
  • int is integer Image description
let number_of_people_in_family: int = 5
Enter fullscreen mode Exit fullscreen mode
  • string is a section of text Image description
let dream_of_girl = "have food with grandma in warm place"
Enter fullscreen mode Exit fullscreen mode
  • float and double is decimal, a number with fraction part Image description
let price_of_milk = 1.19
Enter fullscreen mode Exit fullscreen mode

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

๐Ÿ‘‹ Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay