Skip to main content
Logo

Python programming a ...

    • Қазақша ‎(kk)‎
    • Русский ‎(ru)‎
    • English ‎(en)‎
  • Log in
SYSTEMS.ENU Collapse Expand
PLATONUS.ENU DIRECTUM.ENU MAIL.ENU MY.ENU MOODLE.ENU MOOC.ENU
SYSTEMS.ENU Collapse Expand
PLATONUS.ENU DIRECTUM.ENU MAIL.ENU MY.ENU MOODLE.ENU MOOC.ENU
  1. Courses
  2. Дистанционное обучение
  3. Факультеты
  4. Факультет информационных технологий
  5. Кафедра Информатика
  6. Python programming application (Карымсакова А.Е.)/2024-2025 academic year
  7. Topic 3. Python MySQL
  8. Task 3
  • More

Task 3

Completion requirements
Opened: Thursday, 31 October 2024, 12:00 AM

Exercise 3 (and Solution)

Take a list, say for example this one:

  a = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]

and write a program that prints out all the elements of the list that are less than 5.

Extras:

  1. Instead of printing the elements one by one, make a new list that has all the elements less than 5 from this list in it and print out this new list.
  2. Write this in one line of Python.
  3. Ask the user for a number and return a list that contains only elements from the original list a that are smaller than that number given by the user.



Data retention summary
Get the mobile app
Яндекс.Метрика