aufgaben.py 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. # -*- coding: utf-8 -*-
  2. from random import randint, choice
  3. def einmaleins_produkt_gesucht():
  4. x = randint(1,10)
  5. y = randint(1,10)
  6. aufgabe = f"{ x } * { y } = ?"
  7. ergebnis = x * y
  8. return (aufgabe, ergebnis, 10)
  9. def einmaleins_faktor_gesucht():
  10. x = randint(1,10)
  11. y = randint(1,10)
  12. aufgabe = f"{ x } * ? = { x * y }"
  13. ergebnis = y
  14. return (aufgabe, ergebnis, 10)
  15. def einmaleins_division():
  16. x = randint(1,10)
  17. y = randint(1,10)
  18. aufgabe = f"{ x * y } : { x } = ?"
  19. ergebnis = y
  20. return (aufgabe, ergebnis, 10)
  21. #def zweistellig_plus_zehner():
  22. # x = randint(11, 99)
  23. # y = randint(1, x//10)
  24. #
  25. # aufgabe = f"{ x - 10 * y } + { y }0 = ?"
  26. # ergebnis = x
  27. #
  28. # return (aufgabe, ergebnis, 3)
  29. #
  30. #
  31. #def zehner_minus_einstellig():
  32. # x = randint(1, 89)
  33. #
  34. # aufgabe = f"{ (x//10 + 1) * 10 } - { (x//10 + 1) * 10 - x } = ?"
  35. # ergebnis = x
  36. #
  37. # return (aufgabe, ergebnis, 3)
  38. #
  39. #
  40. #def bis_zum_naechsten_zehner():
  41. # x = randint(1, 8)
  42. # y = randint(1, 9)
  43. #
  44. # aufgabe = f"Von { 10 * x + y } zum nächsten Zehner?"
  45. # ergebnis = 10 - y
  46. #
  47. # return (aufgabe, ergebnis, 3)
  48. #
  49. #
  50. #def minus_einstellig_ueber_zehnergrenze_hinweg_unter_100():
  51. # x = randint(1, 9)
  52. # y = randint(x, 9)
  53. # z = randint(1, 9)
  54. #
  55. # aufgabe = f"{ z }{ x } - { y } = ?"
  56. # ergebnis = (10 * z + x) - y
  57. #
  58. # return (aufgabe, ergebnis, 10)
  59. #
  60. #
  61. #def minus_einstellig_unter_100():
  62. # aufgabe, ergebnis = _minus(range(10,100), range(1,10))
  63. # return aufgabe, ergebnis, 10
  64. #
  65. #
  66. #def _minus(minuend: list, subtrahend: list):
  67. # x = choice(minuend)
  68. # y = choice(subtrahend)
  69. #
  70. # aufgabe = f"{ x } - { y } = ?"
  71. # ergebnis = x - y
  72. #
  73. # return aufgabe, ergebnis
  74. #
  75. #
  76. #def plus_10_bis_19_unter_100():
  77. # aufgabe, ergebnis = _plus(range(1, 80), range(10, 20))
  78. # return aufgabe, ergebnis, 10
  79. #
  80. #
  81. #def _plus(summand_1: list, summand_2: list):
  82. # x = choice(summand_1)
  83. # y = choice(summand_2)
  84. #
  85. # aufgabe = f"{ x } + { y } = ?"
  86. # ergebnis = x + y
  87. #
  88. # return aufgabe, ergebnis