3.2–3.2.1
Syntax, comments, variables and data types (3.2–3.2.1) is a Class 10 Computer Science lesson for the Punjab boards. It walks through the idea in plain steps, then sets a short check, in English, Urdu or Roman Urdu.
Your guide: Miss HiraExplains computers with chai, cricket and your phone.
Chapter 1 of every subject is free. Unlock every chapter of this class with the full course.
Unlock full courseAlready paid? Sign in with the Google account you paid with.
print() displays text: print("Hello, Students!"). Comments start with # and are ignored by the interpreter; they explain the code to people.
A variable is a named container for data whose value can change: age = 71, then age = 60. Names start with a letter or underscore, may contain letters, digits and underscores, are case-sensitive, and cannot be keywords such as if, for or while.
Basic types: int for whole numbers (age = 17), float for decimals (price = 19.99), str for text (name = "Ali") and bool for True or False.
Step 1 / 1
print() displays text: print("Hello, Students!"). Comments start with # and are ignored by the interpreter; they explain the code to people.
A variable is a named container for data whose value can change: age = 71, then age = 60. Names start with a letter or underscore, may contain letters, digits and underscores, are case-sensitive, and cannot be keywords such as if, for or while.
Basic types: int for whole numbers (age = 17), float for decimals (price = 19.99), str for text (name = "Ali") and bool for True or False.
A variable is a labelled box: the label stays, the contents can change.
Found a mistake? Tell us the lesson and the line at exciting@boringeducation.com.
No ads. Tell us what to fix.