You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Subcripting, pulling out the first index of a string, e.g in print("Hello[0]") will print out the first letter in Hello which is H, the character in the index 0
#STRING
print("'Hello[0]' prints the first letter of the word " + "Hello"[0])
print("'World[-1]' prints the last letter of the word " + "World"[-1])
print("Terry"[0]) #prints the first letter of the word T
#String -> because of the curly braces around the intergers
print("123," + "345")
#Interger
print(123+345)
#Float, a number with a decimals point
print("This is a float 👇 ")
print(float(3.6775))
#Boolean
# True False
a = float(123)
b = str(a) #str converts into string, this line converts the float in a to a string
print(a)
# Test it here: https://replit.com/@terrykirungo/1-primitive-data-types#main.py