"My 2 in 1 laptop/tablet goes black and does this weird glitching thing..."
2-in-1 has a bunch of connections bet the keyboard n screen. its weaker than a laptop cuz' the keyboard is detachable. bad news if u have a flaky connection there.
if its brand new or under warranty, i wuld send it back. good luck!
Answer:
The program is as follows:
word = input("Enter a word: ")
if word:
if len(word) <= 4:
word = word[::-1]
else:
word = word[0]+word[1]+word[-2]+word[-1]
print(word)
else:
print('empty!')
Explanation:
This gets input for word from the user
word = input("Enter a word: ")
If input is not empty
if word:
This checks if the length is less than or equal to 4 characters
if len(word) <= 4:
If yes, this reverses the word
word = word[::-1]
If otherwise,
else:
This gets the first, second, second to last two characters
word = word[0]+word[1]+word[-2]+word[-1]
Print the new string
print(word)
Print empty, if input is empty
<em>else:
</em>
<em> print('empty!')</em>
Answer:
It makes it easier for you to pass you end goal