Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working on my FOR loop
#2
#!/usr/bin/python3
import random

#create array with random length
isver = [ "Verfified Purchase" ] * random.randint(0,10)
print(len(isver), isver)
print()

#now we want always ten elements
isver += ["Verified Purchase New"] * (10 - len(isver))
print(len(isver), isver)
Reply


Messages In This Thread
Working on my FOR loop - by wilsonrivas - Dec-06-2018, 11:18 PM
RE: Working on my FOR loop - by heiner55 - May-24-2019, 04:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  while loop not working-I am using sublime text editor mma_python 4 1,149 Feb-05-2023, 06:26 PM
Last Post: deanhystad
  WHILE Loop - constant variables NOT working with user input boundaries C0D3R 4 1,496 Apr-05-2022, 06:18 AM
Last Post: C0D3R
  Why is the while loop not working? mcoliver88 5 3,127 Aug-18-2020, 03:27 PM
Last Post: deanhystad
  Infinite loop not working pmp2 2 1,661 Aug-18-2020, 12:27 PM
Last Post: deanhystad
  Loop not working Nonameface 8 2,947 Jul-19-2020, 12:27 PM
Last Post: snippsat
  for loop script over telnet in Python 3.5 is not working abhijithd123 1 2,906 May-10-2020, 03:22 AM
Last Post: bowlofred
  How to keep a loop containing a web import working in python executable? coder1384 3 2,890 Feb-22-2020, 06:49 PM
Last Post: snippsat
  For loop not working pjgrah01 4 2,823 Nov-03-2019, 11:58 PM
Last Post: pjgrah01
  Appending to list not working and causing a infinite loop eiger23 8 4,007 Oct-10-2019, 03:41 PM
Last Post: eiger23
  plotting inside the loop is not working jenya56 4 3,098 Apr-10-2019, 08:11 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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