Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Welcome to the introduction to C# tutorials. These lessons start with interactive code that you can run in GitHub codespaces. You can learn the basics of C# from the C# for Beginners video series before starting these interactive lessons.
The first lessons explain C# concepts by using small snippets of code. You learn the basics of C# syntax and how to work with data types like strings, numbers, and booleans. It's all interactive, and you'll be writing and running code within minutes. These first lessons assume no prior knowledge of programming or the C# language. Each lesson builds on the prior lessons. You should do them in order. However, if you have some programming experience, you can skip or skim the first lessons and start with any new concepts.
To use GitHub codespaces, you need to create a free GitHub account.
Hello world
In the Hello world tutorial, you create the most basic C# program. You explore the string type and how to work with text.
Numbers in C#
In the Numbers in C# tutorial, you learn how computers store numbers and how to perform calculations with different numeric types. You learn the basics of rounding, and how to perform mathematical calculations using C#.
Tuples and types
In the Tuples and types tutorial, you learn to create types in C#. You can create tuples, records, struct, and class types. The capabilities of these different kinds of types reflect their different uses.
Branches and loops
The Branches and loops tutorial teaches the basics of selecting different paths of code execution based on the values stored in variables. You learn the basics of control flow, which is the basis of how programs make decisions and choose different actions.
List collection
The List collection lesson gives you a tour of the List collection type that stores sequences of data. You learn how to add and remove items, search for items, and sort the lists. You explore different kinds of lists.
Pattern matching
The Pattern matching lesson provides an introduction to pattern matching. Pattern matching enables you to compare an expression against a pattern. The success of the match determines which program logic to follow. Patterns can compare types, properties of a type, or contents of a list. You can combine multiple patterns by using and, or, and not logic. Patterns provide a rich vocabulary to inspect data and make decisions in your program based on that inspection.