حل تمرین جلسه 7: فانکشن ها

Run Settings
LanguagePython
Language Version
Run Command
def only_odd(my_list): for e in my_list: if e % 2 != 0: print(e) # numbers = [0, 1 ,2 ,3 4, 5, 6, 7, 8, 9] numbers = list(range(10)) print(numbers) only_odd(numbers)
def celsius_to_fahrenheit(dama_c): return (dama_c * 1.8) + 32 dama_c = 30 dama_f = celsius_to_fahrenheit(dama_c) print(f"{dama_c} C is {dama_f} F")
def is_gharine(matn): return matn == matn[::-1] matn = "سگ" print(f"{matn} is gharine: {is_gharine(matn)}")
Editor Settings
Theme
Key bindings
Full width
Lines