Revision Q2 5G10
Revision Q2 5G10
American section
IT Department
Go (100)
Turn(90)
Go(100)
Turn(90)
Go (100)
Turn(90)
Go (100)
Turn(90)
**************************************************************
for i in range ( 4 ):
go(100)
turn(360/4)
print("Hello, World")
• Key features:
o Open-source: Free to download and use for any purpose.
o Large community: Provides extensive resources, tools, and libraries.
Output>>>Hello, World
x=5
y = "John"
print(x)
print(y)
• Case-Sensitive
• Variable names are case-sensitive.
• Example
• This will create two variables:
• a = 4
A = "Sally"
#A will not overwrite a
• a=4
• A = "Sally"
• print(a) output >>>> 4
• print(A) output >>>> Sally
Data Types
1. Strings: Text enclosed in quotes. Example : name = "Alice"
2. Numbers: Integers: Whole numbers. Example : age = 25
Floats: Decimal numbers. Example : height = 5.9
3. Boolean: Represents True or False.
a = 33
b = 200
if b > a:
print("b is greater than a")
output:
b is greater than a
7. Conditional Statements
• If-Else Structure:
8. Loops
• For Loop: Iterates over sequences.
for i in range(5):
print(i)
End of Revision