// Variables for name, age, and favorite number
let myName = "Nathan"; // string
let myAge = 15; // integer
let favNumber = 7.7; // float
// snake_case for favorite food, used a string since it's words
let favorite_food = "sinigang";
// PascalCase for favorite hobby used a string since it's words
let favorite_hobby = "basketball";
// camelCase for my favorite color, also used string for the same reason
let $favoriteColor = "blue"
// List with name, age, and favorite number. Used a dollar sign just for fun as the variable
let $myinfo = ['Nathan','15','7']
console.log($myinfo[0]); // output for my case
console.log($myinfo[1]); // output for my age
console.log($myinfo[2]); // output for my favorite number
// Dictionary with name, age, and favorite number
let myself = {
name: 'Nathan', // string, since it's a word
age: 15, // integer, since it's a whole number
favoriteNumber: 7.7 // float, since it has a decimal
};
console.log(myself.name); // Outputs: Nathan
console.log(myself.age); // Outputs: 15
console.log(myself.favoriteNumber); // Outputs: 7.7
# String variable and I wanted a fire name as the output of my name
name = 'Gertrude Fluffernutter'
print(name)
# Integer variable and how old I am as of Oct 7th
age = 16
# My favorite number as a float variable, added .7 since floats have decimals
favorite_number = 7.7
# snake_case for favorite food, made it a string because with other variables I can't put a specific word
favorite_food = "bbq chicken"
# PascalCase for my fav hobby, also needs to be a string for the same reason
FavoriteHobby = "basketball"
# camelCase for my favorite color, also string for the same reason
favoriteColor = "blue"
# List of the variables, put them in order of name, age, and favorite number. Named the variable my_info since it is all things true about me.
about_me = ['Nathan','15','7']
#Dictionary of the variables
myself = {
'name':'Nathan' , # string, since it's a word I used a string
'age': 15, # integer, since it's a whole number I used a integer. Which is also why I didn't put '15' which woulda made a string
'favorite_number': 7.7 # float, since it has a decimal I used a float. Which is also why I didn't put '7.7' which woulda made a string
}
print(myself['name']) # outputs my name of Nathan
print(myself['age']) # outputs my age of 15
print(myself['favorite_number']) # outputs my favorite number 7.7