Python Forum
If 2nd input in the game is correct, replace with 1st input and loop the game
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
If 2nd input in the game is correct, replace with 1st input and loop the game
#4
(Jul-15-2022, 08:50 AM)tylerdurdane Wrote: What I need is: do not restart the game. Take the 2nd input and consider as 1st and keep asking for 2nd input.
So, to clarify... Is something like this what your looking for?
first_data=input('enter a country name: ')
print(first_data)
last_letter=str(first_data[-1])
print(last_letter)
second_data = 'Wrong answer!'
while second_data [-1] != last_letter :
	second_data=input('enter a country name starts with the last letter of previous country name: ')
Reply


Messages In This Thread
RE: If 2nd input in the game is correct, replace with 1st input and loop the game - by BashBedlam - Jul-15-2022, 12:50 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] Game restart problem senka_25 0 129 Jun-13-2024, 02:26 AM
Last Post: senka_25
  Simple Game - Choice Based theor 4 3,274 May-22-2024, 01:17 PM
Last Post: alanbriggs
  My first python game : Tic-Tac-Toe ForsakenDusk 5 456 May-21-2024, 03:24 AM
Last Post: deanhystad
  [PyGame] adding mouse control to game flash77 7 779 May-21-2024, 01:05 AM
Last Post: XavierPlatinum
  get a game to run in full screen mode agencyclearly 1 597 May-12-2024, 11:23 AM
Last Post: menator01
  Game "Fluppy bird" nastia_nadashkevich 1 513 Apr-19-2024, 08:45 PM
Last Post: deanhystad
  [PyGame] Waiting screen until user input - PiBooth world90 2 1,279 Apr-19-2024, 03:34 AM
Last Post: attractalderman
  Isometric game pygame Tiled howardberger 1 956 Jan-31-2024, 10:01 PM
Last Post: deanhystad
  I want to add a bullet function to my game. how would i go about it? Iyjja 5 1,312 Jan-09-2024, 05:42 PM
Last Post: Iyjja
  GPS Points to map for game/simulator AvgPlum 1 2,110 Jun-22-2023, 06:38 PM
Last Post: marynetherton

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020