Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions BrowserHistory/rock_paper_scissors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
Rock, Paper, Scissors Game (CLI Version)
Triple Round : Rock, Paper, Scissors Game (CLI Version)
Final round is the Winning Round
Author: Your Name
"""

Expand Down Expand Up @@ -38,10 +39,13 @@ def decide_winner(player, computer):

def main():
"""Main function to play the game."""
user_choice = get_user_choice()
computer_choice = get_computer_choice()
print(f"Computer chose: {computer_choice}")
print(decide_winner(user_choice, computer_choice))
for i in range(1, 4):
print(f"round -> {i}\n")
user_choice = get_user_choice()
computer_choice = get_computer_choice()
print(f"Computer chose: {computer_choice}")

print(f"Final result : {decide_winner(user_choice, computer_choice)}")


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion BrowserHistory/tests/test_browser_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ def test_complex_navigation(self):
# Verify we can't go forward to cleared history
self.assertEqual(self.browser.forward(1), "page4.com")


# starting point of code
if __name__ == "__main__":
unittest.main()
1 change: 1 addition & 0 deletions Cat/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def no_files():
# Graceful exit for Ctrl + C, Ctrl + D
except KeyboardInterrupt:
exit()
# exit when no data found in file
except EOFError:
exit()

Expand Down
2 changes: 2 additions & 0 deletions oryx-build-commands.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PlatformWithVersion=Python
BuildCommands=conda env create --file environment.yml --prefix ./venv --quiet
1 change: 1 addition & 0 deletions sha1.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,6 @@ def main():
print(SHA1Hash(hash_input).final_hash())


# starting point of code
if __name__ == "__main__":
main()
18 changes: 12 additions & 6 deletions voice.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# modules for use of voice
from gtts import gTTS
from colorama import Fore
import os

# Define the text you want to convert to speech
text = "Hello! This is a sample text to convert to speech."

# Create a gTTS object
tts = gTTS(text=text, lang="en")
# Exception Handaled.
try:
# Create a gTTS object
tts = gTTS(text=text, lang="en")

# Save the audio file
tts.save("output.mp3")
# Save the audio file in mp3 format
tts.save("output.mp3")

# Play the audio file
os.system("start output.mp3")
# Play the audio file from system
os.system("start output.mp3")
except Exception as e:
print(Fore.RED, e, Fore.RESET)
5 changes: 4 additions & 1 deletion vowel remover function.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ def vowel_remover(text):
if l.lower() not in "aeiou":
string += l
return string
print(vowel_remover("hello world!"))

# this code runes on only this file
if __name__=="__main__":
print(vowel_remover("hello world!"))