Lesson 22 Python(level 3) while and for in loop with else. Continue VS pass.

Veröffentlicht am: 24 Mai 2024
auf dem Kanal: code_way
6
2

Hi, thanks for viewing.

Automation QA course Python(pytest)    • QA Automation  

Here's how to install PyCharm and Python:    • Installing Python and PyCharm on macOS Ven...  

Here's how to work with Git:    • GitHub UI: Edit and download code without ...  

Python for beginners:    • Lesson 2 Python: Data input (input), mathe...  

Python level 2:    • Python level 2  

Tasks for better understanding:
Task 1
Create a program that iterates through a list of numbers. Use a conditional statement with the continue command to skip processing numbers that are less than 0. Use the pass command to ignore zero.

Task 2
Create a program that finds the first number in a list that is divisible by 7 without a remainder. Use a for loop and the break command to stop iterating through elements after finding the first number. If such a number is not found, the loop should display a message stating that there are no numbers in the list divisible by seven.

Task 3
Write a program that uses a for loop to iterate through a list of numbers. Skip operations with numbers that are equal to or less than 0. Output the sum of all other numbers.

Test based on this lesson:
https://docs.google.com/forms/d/e/1FA...


Auf dieser Seite können Sie das Online-Video Lesson 22 Python(level 3) while and for in loop with else. Continue VS pass. mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer code_way 24 Mai 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 6 Mal angesehen und es wurde von 2 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!