Start with Python
Python is a high-level programming language that is versatile and easy to learn. It is known for its simple and readable syntax, which makes it an excellent choice for beginners and experienced programmers alike. Python is used in web development, data analysis, artificial intelligence, scientific computing, automation, and much more. It has a large standard library that provides built-in functions and modules to help you write code efficiently. Python also has a thriving community and extensive documentation, making it easy to find help and resources online.
Getting started with Colab
Colab is a hosted Jupyter Notebook service that requires no setup to use and provides free access to computing resources, including GPUs and TPUs. Colab is especially well suited to machine learning, data science, and education.
Click the following link to start the could VM python. https://colab.research.google.com/
Run your first code
Try to copy the follow code into a cell, then run it.
print("Hello youtube!")
The print()
function will help you to line / print out your target string.
# This is a comment, by using "# at the front
print("Oh hay")
print("Hello there")
print("My name is tom")
Variables
Python is a weak type programming languages, you may define your variables without the type annotation (註釋)
my_string = "Hello mate" # str
some_numbers = 123 # int
some_float_numbers = 123.45 # float
goodBoolean = True # bool
inverseBoolean = False # bool
Casting Variables
Python allow you to convert variables type with a single easy functions.
my_string_num = str(87) # "87"
my_float_num = float(87) # 87
# Using `type()` to get the variables type
print(type(my_string_num)) # <class 'str'>