Skip to content

Instantly share code, notes, and snippets.

@NonymousMorlock
Last active November 17, 2023 12:44
Show Gist options
  • Save NonymousMorlock/a3dcc107b6b1839b0a4a5bc9bbb125ce to your computer and use it in GitHub Desktop.
Save NonymousMorlock/a3dcc107b6b1839b0a4a5bc9bbb125ce to your computer and use it in GitHub Desktop.
Convert these to dart
# remember, in dart, when a function doesn't return anything, then it's type is void
def greeting(name):
print(f'Hello {name}!!!')
def sum(first_number, second_number):
return first_number + second_number
def difference(n1, n2):
print(f'The difference between {n1} & {n2} is {n1 - n2}')
def all_names(first_name, second_name, third_name, fourth_name, fifth_name):
return [first_name, second_name, third_name, fourth_name, fifth_name]
def sum_of_product_and_quotient(first_number, second_number):
product = first_number * second_number
quotient = first_number / second_number
resultingSum = product + quotient
return resultingSum
greeting('Louis')
our_sum = sum(1, 2)
print(our_sum)
difference(2, 1)
students = all_names('Louis', 'Paul', 'Joy', 'Michael', 'Gideon')
print(students)
result_sum = sum_of_product_and_quotient(2, 3)
print(result_sum)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment