Advertisement
Chl_Snt

№9. Функции

Feb 22nd, 2023
846
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.20 KB | None | 0 0
  1. def function():
  2.     print("Функция работает!")
  3.  
  4. function()
  5.  
  6.  
  7.  
  8.  
  9.  
  10. def search():
  11.     num = words.count("клубника")
  12.     if num != 0:
  13.         print("Клубника найдена")
  14.     else:
  15.         print("В списке нет никаких клубник")
  16.  
  17.  
  18.  
  19.  
  20.  
  21. words = ['Идет', 'бычок,', 'качается', 'вздыхает', 'на',
  22.          'ходу', 'ох,', 'доска', 'кончается', 'сейчас', 'я', 'упаду']
  23.  
  24. while True:
  25.     new = input("Введи новое слово -> ")
  26.     words.append(new)
  27.     search()
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. def math(number):
  35.     answer = number * 10
  36.     print(f"Ответ: {answer}")
  37.  
  38. x = int(input("Введи число -> "))
  39. math(x)
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46. def math(number):
  47.     answer = number * 10
  48.     return f"Ответ: {answer}"
  49.  
  50. x = int(input("Введи число -> "))
  51. math(x)
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58. def math(number):
  59.     answer = number * 10
  60.     return f"Ответ: {answer}"
  61.  
  62. x = int(input("Введи число -> "))
  63. print(ans)
  64. ans = math(x)
  65.  
  66.  
  67.  
  68.  
  69.  
  70. def square(a, b):
  71.     value = a * b
  72.     return value
  73.  
  74.  
  75.  
  76. def cube(num):
  77.     result = square(num, num) * 2
  78.     return result
  79.  
  80. print(cube(3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement