Posts by kdz • 31 points
2 posts
-
0
votes2
answers69
viewsQ: Program with boolean expressions enters the if block every time
prefixes = "JKLMNOPQ" suffix = "ack" for letter in prefixes: if letter[0] == "Q"or"O": print(letter+"uack") continue print(letter+suffix) Expected response: Jack Kack Lack Mack Nack Ouack Pack Quack…
-
1
votes2
answers1697
viewsQ: Doubt Random.shuffle() returns None(inside print)
Because when random.shuffle() used inside the string returns None? I found out after you can use shuffle get off the print and put in a single line but did not understand why it lock. Sample code…
python-3.xasked kdz 31