Data Types

Welcome, aspirants, to a critical juncture in your programming journey. Today, we explore the fundamental concepts of Python — the basic data types.

˙⋆˖⁺‧₊☽◯☾₊‧⁺˖⋆˙

Int & Float Types

In programming, numbers are used to represent numerical values.

There are two basic types of number values:

print(12) # Int number print(3.14) # Float number

Arithmetic Operations (operators):

#Examples: print(5 + 3) # Addition print(10 - 4) # Subtraction print(2 * 6) # Multiplication print(8 / 2) # Division

String Type

String – sequence of characters enclosed within quotation marks. Strings are used to represent text.

print("Any text =^-^=") # String type

String Syntax

In Python, a string is a sequence of characters enclosed in single quotes (' '), double quotes (" "), or triple quotes (''' ''' or """ """).

In many other programming languages (e.g. C++, C#, Java), single quotes (' ') are used for single characters, and double quotes (" ") – for strings.
So it's recommended to keep the same in Python.

#Example: Creating strings char = 'A' string = "Magic Wand"

Difference: Numbers and Strings

Practical Application

In the Hall of Elements, you must demonstrate your understanding of fundamental components: strings, integers, and floats.

⋆˖⁺‧₊ Output mage's name (string), age (integer), and power level (float). Use the print( ) function. ₊‧⁺˖⋆

Sample Output:
Mage Name: Alaric
Mage Age: 120
Power Level: 95.7

Remember: Strings are for names and text, integers for whole numbers, and floats for numbers with decimals.

#Type your code below: