🧠Big Idea 3 - Unit 1
📅 October 11, 2024
Summary
This lesson introduces core programming concepts like variables, naming conventions, and basic data types in both Python and JavaScript. Key data types include:
- String – text within quotes (e.g.,
"Hello"
) - Integer – whole numbers (e.g.,
7
) - Float – decimal numbers (e.g.,
7.5
) - Boolean – true or false values (
True
,False
) - Array / List – collections of values (
[1, 2, 3]
) - Object / Dictionary – key-value pairs (e.g.,
{"name": "Kush"}
)
The lesson also compares different variable naming conventions: snake_case
, camelCase
, and PascalCase
.
Scroll down to view coding examples and homework!
# String & Integer variables
subject = "Math"
birthday = "August 38th"
favoriteNumber = 7
# Boolean values
cold = False
busy = True
print(cold) # False
print(busy) # True
# Dictionary with a list
my_stuff = {
'name': "Soumini",
'age': 14,
'subjects': ['Math', 'Chemistry', 'CSP', 'English', 'History'],
}
print(my_stuff)
name = "Soumini"
age = 14
favorite_number = 7.0
favorite_food = "none" # snake_case
FavoriteHobby = "reading" # PascalCase
favoriteColor = "all colors but mostly purple" # camelCase
myList = [name, age, favorite_number]
me = {
'name': name,
'age': age,
'favorite_number': favorite_number
}
// Variables
let fav_subject = "math";
let hobby = "reading";
let number = 7;
// Object
var event = {
date: "September 36th",
time: "4 pm",
thing: "Birthday Party",
location: "Saturn the Planet",
participants: 30,
};
console.log(event);
// Concatenation and math
let first = 61409;
let second = 90709;
console.log(first + second); // Adds numbers
let one = "I don't like ";
let two = "bell peppers";
console.log(one + two); // Combines strings
let name = "Soumini";
let age = 14;
let favorite_number = 7.0;
let favorite_food = "none";
let FavoriteHobby = "reading";
let favoriteColor = "all colors but mostly purple";
let myList = ['Soumini', 14, 7];
let me = {
'name': 'Soumini',
'age': age,
'favorite_number': favorite_number
};