How to print each element of my list to a defined length (5), so for example: myList = ["abcdefgh", "ijklmnop"] The output I’m looking for is: abcde ijklm I’ve tried this (printing dates from an excel sheet): i = 2 x =0 while i < maxR: valuesItems = wb0["C" + str(rowList[i])].value itemDate.append(valuesItems) print(len(itemDate[x])) i =… Read More How to print each element of a list until a certain length Python
So I have this program where I need the user to choose a length for a key in python but I want the choice of the user to be restricted with the provided lengths only and I don’t quite know how to do that here is the code available_len = [5 , 10 , 14… Read More How to restrict the choice of a user in python?
I was making a sign-up page and everything worked and got send to the db but you could enter a weak pwd. I wanted to make sure that the pwd length had a minimum length of 8. I added these lines of code but when I tested it it skipped this code and you could… Read More function for checking strlen of a password doesn't work in php
Like the title says, I am trying to recreate the array.length method and store it as a method on an object. The problem is that I can’t seem to figure out how to set the length property to zero… I get this error that says "should have a ‘length’ property that is initially 0" and…… Read More Trying to recreate the array.length method
word1 = input() word2 = input() a = len(word2) b = len(word1) count = b while (word2[a-1] == word1[b-1]): count-=1 a -= 1 if count == 0: break else: print(‘it cant be made’) b-=1 print(‘it can be made’) What I am trying to do is compare the last letter of word2 to the last letter… Read More I am trying to make word1 from the letters of word2 in Python