Computer Science, asked by sainavin582, 9 months ago

Jamie and Leo are classmates who just started learning numbers. They both decided to play a game with what they learnt. Jamie will start saying number 1 and Leo should say 2 and again Jamie says 3.In the same manner both will alternatively spell the consecutive number. But if number 5 or a multiple of five comes , they should say "Bus/ bUs/ buS" instead of the number as per the sample output.


Write a program to display the numbers and word they spell.


The input to the program is the highest number,that ends the game

Answers

Answered by gowrav55
0

Answer:

make me brainer

Explanation:

this your question

Jamie and Leo are classmates who just started learning numbers. They both decided to play a game with what they learnt. Jamie will start saying number 1 and Leo should say 2 and again Jamie says 3.In the same manner both will alternatively spell the consecutive number. But if number 5 or a multiple of five comes , they should say "Bus/ bUs/ buS" instead of the number as per the sample output.

Write a program to display the numbers and word they spell.

The input to the program is the highest number,that ends the game.

answer i dont know

by doing maths u will get iam 100 percent sure

Answered by poojan
1

Python program for Number and word sequence game

Note : As Jamie and Leo should say the numbers in this game, they too should be considered as input.

Language used : Python Programming

Program :

jamie=0

leo=0

highestnumber=int(input())

for i in range(1,highestnumber+2):

   if i==highestnumber+1:

       print("Game is a Tie")

       break

   if i%2!=0:

       jamie=str(input("Jamie's turn : "))

       if i%5==0 and i>=5 and ((jamie=="Bus") or (jamie=="bUs") or (jamie=="buS")):

           continue

       if i%5==0 and i>=5 and ((jamie!="Bus") or (jamie!="bUs") or (jamie!="buS")):

           print("Out! Leo is the WINNER!")

           break

       elif int(jamie)!=i:

           print("Out! Leo is the WINNER!")

           break

           

   else:

       leo=input("Leo's turn : ")

       if i%5==0 and i>=5 and ((leo=="Bus") or (leo=="bUs") or (leo=="buS")):

           continue

       if i%5==0 and i>=5 and ((leo!="Bus") or (leo!="bUs") or (leo!="buS")):

           print("Out! Jamie is the WINNER!")

           break

       elif int(leo)!=i:

           print("Out! Jamie is the WINNER!")

           break

Inputs and outputs :

Input 1 :

10

Jamie's turn : 1

Leo's turn : 2

Jamie's turn : 3

Leo's turn : 4

Jamie's turn : Bus

Leo's turn : 6

Jamie's turn : 9

Output 1 :

Out! Leo is the WINNER!

Input 2 :

30

Jamie's turn : 1

Leo's turn : 2

Jamie's turn : 3

Leo's turn : 4

Jamie's turn : 5

Output 2 :

Out! Leo is the WINNER!

Input 3 :

10

Jamie's turn : 1

Leo's turn : 2

Jamie's turn : 3

Leo's turn : 4

Jamie's turn : bUs

Leo's turn : 6

Jamie's turn : 7

Leo's turn : 8

Jamie's turn : 9

Leo's turn : buS

Output 3 :

Game is a Tie

Explanation :

In this program, all you need to take a final highest number as range from user and make two users play till they reach the number by taking the series of consecutive numbers from them as inputs. If they break the series of if they do enter any multiples of 5, instead of using "Bus" or "bUs" or "buS", they are considered to be out of the game, resulting the one remained as winner.

Learn more :

  • Sailent features of python.

       brainly.in/question/12206981

  • Advantages of Python Programming?

        brainly.in/question/11007952

Attachments:
Similar questions