# Variable and Strings
n = "my name is "
name = "Akshaj"
# Concat
print (n+name)
print (name * 10)
# integers and operations
n_1 = 2
n_2 = 3
n_3 = 4
n_4 = 5
n_5 = 3.141
print (n_1 + n_2)
print (n_2 - n_1)
print (n_3 * n_4)
print (n_3 / n_1)
print (n_4 // n_1)
print (n_5 * n_2)
equation = n_4 % n_1
if equation >= 2:
print ("The answer is less than 2")
else:
print ("The answer is more than 2")
print ("-"*10)
# Dictionaries, Booleans, lists, len, variable casing,==, f-strings,
Updated_Profile = {
"name": "Akshaj Gurugubelli",
"age": 15,
"city": "San Diego",
"favorite_color": "Blue",
"hobbies": ["Tennis", "Basketball", "Football", "Eating", "Reading", "Coding", "Watching my phone", "Running"],
"new_skill" : None
}
print("Profile:", Updated_Profile)
hobby_question = (input("Is your hobby available today, answer true or false"))
if hobby_question == "true":
print ("Your Hobby is available today")
elif hobby_question == "false":
print ("Your Hobby is not available today")
else:
print ("Input error, make sure your answer is all lowercase")
total_hobbies = len('hobbies')
print(f"I have {total_hobbies} hobbies.")
favorite_hobbies = ("Tennis", "Basketball")
print (f"My favorite hobbies are {favorite_hobbies}")
print ("-" * 10)
# Boolean
has_socks = True
# If/Else Statement
# We use the boolean in the if/else stament
if has_socks:
print ("You're good to go")
else:
print ("You need to get socks")
# Nested conditionals
has_socks = True
has_shoes = False
if has_socks:
if has_shoes:
print ("You are good to go outside")
else:
print ("You need to get shoes")
else:
print ("You need to get socks")
my name is Akshaj
AkshajAkshajAkshajAkshajAkshajAkshajAkshajAkshajAkshajAkshaj
5
1
20
2.0
2
9.423
The answer is more than 2
----------
Profile: {'name': 'Akshaj Gurugubelli', 'age': 15, 'city': 'San Diego', 'favorite_color': 'Blue', 'hobbies': ['Tennis', 'Basketball', 'Football', 'Eating', 'Reading', 'Coding', 'Watching my phone', 'Running'], 'new_skill': None}
Your Hobby is available today
I have 7 hobbies.
My favorite hobbies are ('Tennis', 'Basketball')
----------
You're good to go
You need to get shoes