Skip to content

Instantly share code, notes, and snippets.

@ReaganS94
Created January 28, 2025 14:15
Show Gist options
  • Select an option

  • Save ReaganS94/c6af2381e09b2442973ec60399679686 to your computer and use it in GitHub Desktop.

Select an option

Save ReaganS94/c6af2381e09b2442973ec60399679686 to your computer and use it in GitHub Desktop.
""" # All my lists with number
numbers = [3, 5, 7, 2, 8]
numbers2 = [34, 15, 745, 324232, 98]
bobby = 5
numbers3 = ["5", 5, 78, 756543.3223, 92.6]
# () = parentheses
# [] = square brackets -> option + 5
# {} = curly brackets -> option + 8
# : = colon
# ; = semi-colon
# `` = backticks
# ~ = tilde
# " " = double quotation marks
# ' ' = single quotation marks
largest = numbers2[0]
for num in numbers2[1:]:
if num > largest:
print("number changed", num)
largest = num
else:
print("The variable 'largest' hasn't changed")
print("The largest number is: ", largest) """
# Outcome 1 = error |||||
# Outcome 2 = Enters the first conditional ||
""" numbers2 = [34, 15, 745, 3242, 98]
for num in numbers2:
print("Outer loop number: ",num)
nums = [2, 5, 7, 2]
for element in nums:
print("inner loop number: ",element)
print("hey how is it going") """
#Julien Machine
#34
#2
#hey how is it going
#Abiy Machine |||||
# 34, 15, 745, ..., 98
# 2, 5, 7, 2
#hey how is it going
# function
# inside parenthesis -> argument
#print("Hello", "how are you?")
x = int(1)
name = "Bobby"
# print(type(name))
# print("it's christmas")
# my_list = [4, 5, 1]
# my_tuple = (1, 3, 4)
# for num in range(0, 6, 3):
# print(num)
my_list = [1, 2, 3, 4]
#key-value pairs
book = {
"title": "LOTR",
"author": "Tolkien",
"genre": "fantasy",
"copies_sold": 785438
}
# print(book)
doYouLoveMeOrNot = False
name = "Dennis"
# for letter in name:
# print(letter)
# print(len(name))
my_var = "Heya "
my_other_var = "how are you"
# print(my_var + my_other_var)
# username = input("Choose a username: ")
# print(f"hey, {username}. Welcome!")
num1 = 6
num2 = 5
print(num1 == num2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment