Computer Science, asked by Aadityarajak1448, 1 month ago

Rick Is A Fan Of Logic-based Games. However, He Is Bored Of The Classic Ones, Like Sudoku And Mastermind, Since He Has Solved So Many Of Them. Recently He Found A New Game In Which One Is Given A String With Some Question Marks In It.

Answers

Answered by meenasenthiltup
0

Answer:

play gta

Explanation:

Rick Is A Fan Of Logic-based Games. However, He Is Bored Of The Classic Ones, Like Sudoku And Mastermind, Since He Has Solved So Many Of Them. Recently He Found A New Game In Which One Is Given A String With Some Question Marks In It.

Answered by Banjeet1141
0

Answer:

In this question we have to use the knowledge of the python language to write the code, so we have to:

The code is written below-

import random

import string

def solution(riddle):

 s = list(riddle)

 for i in range(len(riddle)):

     alpha ="".join(random.choice(string.ascii_letters)for x in range(1))

     alpha = alpha.lower()

     if s[i] == '?':

         if i > 0 and i < len(s)-1:

             if s[i+1] != alpha:

                 s[i] = alpha

             elif s[i-1] != alpha:

                 s[i] = alpha

             else:

                 i=i

         else:

             if i == 0:

                 if s[1] != alpha:

                     s[i] = alpha

                 else:

                     i = i

             else:

                 if s[i-1] != alpha:

                     s[i] = alpha

                 else:

                     i = i

 riddle = ""

 for ele in s:

     riddle+=ele

 return riddle

Read here more-

Is Python a high-level Language?

https://brainly.in/question/16086474

What is the Python programming language?

https://brainly.in/question/16086632

Similar questions