I'm writing a program that is going to be used for encryption. It can only encrypt 64 letters at a time. How can I make a check for that using len()?
Jacklittle01 -3 Light Poster
Recommended Answers
Jump to PostHint ...
# this test string will have 65 characters s = 'q' * 65 length = len(s) if length <= 64: encrypted = encrypt(s) else: print("string exceeds 64 characters")
All 4 Replies
Gribouillis 1,391 Programming Explorer Team Colleague
CodingCabbage 0 Light Poster
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.