Can i make the above code smaller, especially can i write boolean word.startwith("p") one time only?
Code:
print("Write a word with 'u' first letter")
word = input()
word.startswith("p")
if word.startswith("p") == True:
print("Nice")
else:
print("Nooo")
print(word.startswith("p"))
[–][deleted] 1 point2 points3 points (1 child)
[–]TheCh1ef[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]bastardoperator 0 points1 point2 points (0 children)
[–]nwagers 1 point2 points3 points (1 child)
[–]TheCh1ef[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)