Python Forum
Purpose of the keyword "pass"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Purpose of the keyword "pass"
#4
(Feb-24-2018, 07:33 AM)Tim Wrote: the fourth line in the output shouldn't appear. In other word, even if we remove "pass" the output remains the same.

I think you mix pass with continue

for letter_num, letter in enumerate("Howdy!", start=1):
    if letter == "w":
        continue
    print('Letter ', letter_num, ' is ', letter)
Output:
Letter 1 is H Letter 2 is o Letter 4 is d Letter 5 is y Letter 6 is !
Reply


Messages In This Thread
Purpose of the keyword "pass" - by Tim - Feb-24-2018, 07:33 AM
RE: Purpose of the keyword "pass" - by wavic - Feb-24-2018, 07:44 AM
RE: Purpose of the keyword "pass" - by Gribouillis - Feb-24-2018, 07:48 AM
RE: Purpose of the keyword "pass" - by buran - Feb-24-2018, 07:58 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Find a specific keyword after another keyword and change the output sgtmcc 5 958 Oct-05-2023, 07:41 PM
Last Post: deanhystad
  How to pass encrypted pass to pyodbc script tester_V 0 952 Jul-27-2023, 12:40 AM
Last Post: tester_V
  What is the useful purpose of Python? dorlow 2 1,798 Sep-16-2020, 04:22 PM
Last Post: JaneOgden91fCL
  Pass by object reference when does it behave like pass by value or reference? mczarnek 2 2,635 Sep-07-2020, 08:02 AM
Last Post: perfringo
  print scripts example includes comma that seems to serve no purpose flour_power_33 5 2,924 Sep-02-2020, 03:32 AM
Last Post: flour_power_33
  What is the purpose of this append command! Captain_farrell 4 2,580 Apr-29-2020, 04:34 AM
Last Post: bowlofred
  Pass by reference vs Pass by value leodavinci1990 1 2,275 Nov-20-2019, 02:05 AM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020