Chapter 4 Challenges
Chapter 4 Challenges
#challenge2
message=input("type a message and ill reverse it:")
reverse=message[::-1]
print(reverse)
#challenge3
import random
while word:
position = random.randrange(len(word))
new_word += word[position]
word = word[:position] + word[position + 1:]
if hint == 1:
print('hi synonym')
elif hint == 2:
print('greet synonym')
elif hint == 3:
print('computer synonym')
elif hint == 4:
print('living room essential')
else:
print('You don\'t need any hint')
score=0
if hint=none:
score=score+10
else:
score=score-10
if guess == new_word:
print('You are correct! with a score of", score)
else:
print(f'Wrong guess. The correct word is {word}. with a score of', score)
#challenge4
import random