continue keyword is used to continue the loop if any error occur LAB TASK 1

# Continue keyword is used to continue the loop if any

This preview shows page 4 - 5 out of 5 pages.

continue keyword is used to continue the loop if any error occur. LAB TASK 1. Write a piece of Python code that prints out the string (your_name) and its length. 2. Write a piece of Python code that prints out the string ' your_name ' if the value of an integer variable, happy, is strictly greater than length of string. 3. Print the following pattern * * * * * * * * * * * * * * * Course Instructor: Dr. Aimal Khan Lab Instructor: Engr. Ayesha Batool DE-40 (CE)
College of Electrical & Mechanical Engineering, NUST Department of Computer Engineering 4. Take a number input from user and print its multiplication table. 5. Iterate the given list and print numbers which are divisible by 5 and if number is greater than 140 stop the loop iteration. Note; Use ‘ break’ statement. List1 = [8, 16, 15, 32, 55, 85, 120, 133, 151, 154, 210] 6. Reverse the list using for while loop and indexing technique. List2 = [20, 30, 40, 50, 60, 70, 80, 90] 7. Write a Python code that prints all the numbers from 0 to 10 except 3 6 and 9. Note: Use 'continue ' statement. Course Instructor: Dr. Aimal Khan Lab Instructor: Engr. Ayesha Batool DE-40 (CE)

#### You've reached the end of your free preview.

Want to read all 5 pages?

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes