Skip to content

Instantly share code, notes, and snippets.

View MPramodhkumar's full-sized avatar
🎯
Focusing

Pramodhkumar MPramodhkumar

🎯
Focusing
View GitHub Profile
@MPramodhkumar
MPramodhkumar / TicTacToeGame.py
Created November 2, 2022 09:08
TicTacToe Game using Python...
instructions="""
This is our TicTacToe Board
1 | 2 | 3
---|---|---
4 | 5 | 6
---|---|---
7 | 8 | 9
*Instructions:
1.Insert the number(1-9)
2.You Must fill all 9 spots to get the result
@MPramodhkumar
MPramodhkumar / GuessNumber.py
Created October 12, 2022 13:22
Python Program for Guess the random number in given attempts
#guessing game using python
import random
import math
l=int(input("Enter lower boundary:"))
h=int(input("Enter upper boundary:"))
num = random.randint(l, h)
x=h-l+1
a=int(math.log(x,2))
while True:
print(f'Guess a number between {l} and {h}')
QUESTION
A robot moves in a plane starting from the original point (0,0). The robot can move UP, DOWN, LEFT, and RIGHT with given steps. Please write a program to compute the distance from the current position after a sequence of movements and the original point. If the distance is a float, then just print the nearest integer.
Input Format:
The first line of input consists of one string and one integer
The second line of input consists of one string and one integer
Same for the other new lines until the user enters a "STOP".
Output Format: