FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Joshua Levy · nativecs/PythonCoding@35f1f69 · GitHub

Commit 35f1f69

Browse files
committed
Joshua Levy
0 parents  commit 35f1f69

22 files changed

Lines changed: 641 additions & 0 deletions

‎Affirmations Generator.py‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
print("********Random affirmations generator********")
2+
print("***This program will display a positive message based on your chosen day***")
3+
print("\n")
4+
name = input("Please enter your name: ")
5+
print("Hi",name,"nice to meet you")
6+
dayOfWeek = input("What is the current day of the week? ")
7+
if dayOfWeek == "Monday" or dayOfWeek == "Tuesday" or dayOfWeek == "Wednesday" or dayOfWeek == "Thursday":
8+
favThings = input(f"Tell me what you usually do on {dayOfWeek}: ")
9+
else:
10+
print("This is not a valid day, please try again")
11+
if dayOfWeek == "Monday":
12+
if favThings == "going out" or favThings == "learning English" or favThings == "going to gym":
13+
print("Well,", name,",",dayOfWeek,"is usually the beginning and,",favThings,"is what you should be doing, carry on")
14+
else:
15+
print("I'm sure on",dayOfWeek,"you can do that, but I can't motivate you on this")
16+
if dayOfWeek == "Tuesday":
17+
if favThings == "visting friends":
18+
print("Awesome!, you should",favThings,"on",dayOfWeek)
19+
20+

‎CLI UI using f strings.py‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
def colorChange(color):
2+
if color=="red":
3+
return ("\033[31m")
4+
elif color=="white":
5+
return ("\033[0m")
6+
elif color=="blue":
7+
return ("\033[34m")
8+
elif color=="yellow":
9+
return ("\033[33m")
10+
elif color == "green":
11+
return ("\033[32m")
12+
elif color == "purple":
13+
return ("\033[35m")
14+
15+
title = f"{colorChange('red')}={colorChange('white')}={colorChange('blue')}= {colorChange('yellow')}Music App {colorChange('blue')}={colorChange('white')}={colorChange('red')}="
16+
17+
print(f" {title:^35}")
18+
print(f"🔥▶️\t{colorChange('white')}Radio Gaga")
19+
print(f"\t{colorChange('yellow')}Queen")
20+
21+
prev = "prev"
22+
next = "next"
23+
pause = "pause"
24+
25+
print(f"{colorChange('white')}{prev:<35}")
26+
print(f"{colorChange('green')}{next:^35}")
27+
print(f"{colorChange('purple')}{pause:>35}")
28+
29+
30+
print()
31+
print()
32+
text = "WELCOME TO"
33+
print(f"{colorChange('white')}{text:^35}")
34+
text = "-- ARMBOOK --"
35+
print(f"{colorChange('blue')}{text:^35}")
36+
text = "Definitely not a rip off"
37+
print(f"{colorChange('yellow')}{text:>35}")
38+
text = "a certain other social"
39+
print(f"{colorChange('yellow')}{text:>35}")
40+
text = "networking site"
41+
print(f"{colorChange('yellow')}{text:>35}")
42+
text = "Honest."
43+
print(f"{colorChange('red')}{text:^35}")
44+
text = "Username: "
45+
username = input(f"{colorChange('white')}{text:^35}")
46+
text = "Password: "
47+
username = input(f"{colorChange('white')}{text:^35}")

‎Chracter Health.py‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import random
2+
3+
print("⚔️ Character Stats Generator ⚔️")
4+
print()
5+
6+
while True:
7+
def dice(sides):
8+
number = random.randint(1, sides)
9+
return number
10+
def player():
11+
roll1 = dice(6)
12+
roll2 = dice(8)
13+
health = roll1 * roll2
14+
return health
15+
16+
gameHealth = player()
17+
18+
character = input("Enter your character: ")
19+
print("The health of", character, "is", gameHealth, "hp")
20+
ask = input("Would you like to try again? Y or N: ")
21+
if ask == "N":
22+
print("Goodbye")
23+
break
24+
elif ask == "Y":
25+
continue
26+
exit()
27+
28+
29+
30+

‎Function colour text.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import time
2+
def newPrint(colour, word):
3+
if colour== "red":
4+
print("\033[31m", word, sep="", end="")
5+
elif colour == "green":
6+
print("\033[0;32m", word, sep="", end="")
7+
else:
8+
print("\033[0m", word, sep="", end="")
9+
10+
11+
print("Super Subroutine")
12+
print("With my ", end="")
13+
newPrint("red", "new program")
14+
newPrint("reset", " I can just call red('and') ")
15+
newPrint("green", "it will print in red ")
16+

‎Gradebook builder.py‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
print("welcome to the online grade checker")
2+
while True:
3+
ask = input("Please enter the name of the subject: ")
4+
if ask == "Science" or ask == "Maths" or ask == "ICT" or ask == "English":
5+
grade = int(input(f"Please enter your marks obtained in {ask}: "))
6+
if grade >= 90 and grade <= 100:
7+
print(f"Your grade in {ask} is A+")
8+
elif grade >= 80 and grade <= 89:
9+
print(f"Your grade in {ask} is A")
10+
elif grade >= 70 and grade <= 79:
11+
print(f"Your grade in {ask} is B")
12+
elif grade >= 60 and grade <= 69:
13+
print(f"Your grade in {ask} is C")
14+
elif grade >= 50 and grade <= 59:
15+
print(f"Your grade in {ask} is D")
16+
elif grade <= 50:
17+
print(f"Your grade in {ask} is U")
18+
else:
19+
print("Invalid subject entered. Enter valid subject")
20+
repeat = input("Would you like to try again?, enter Y or N: ")
21+
if repeat == "Y":
22+
continue
23+
else:
24+
if repeat == "N":
25+
print("Goodbye")
26+
break

‎Guessing Number game.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import random
2+
print("Guess the Number, you have 3 tries")
3+
number = random.randint(1,10)
4+
count = 0
5+
while count < 3:
6+
askUser = int(input("Enter your best guess: "))
7+
if askUser < number:
8+
count += 1
9+
print("your guess is too low, try again: count(s)", count)
10+
elif askUser > number:
11+
print("your guess is too high, try again: count(s)", count)
12+
count += 1
13+
elif askUser == number:
14+
print("brilliant, you have the right number")
15+
count += 1
16+
exit()

‎IF Nested Statements.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python3 -m pygame.examples.aliens

‎Interactive Maths Table.py‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
ask = "Y"
2+
counter = 0
3+
while ask == "Y":
4+
print("Interactive Maths table")
5+
number = int(input("Enter your number: "))
6+
for table in range(1, 11):
7+
ask = int(input(f"What is {number} x {table} = ?: "))
8+
multple = number * table
9+
if ask == multple:
10+
counter += 1
11+
print(f"correct answer!, you've got",counter,"points")
12+
else:
13+
print("incorrect answer, 0 points")
14+
else:
15+
ask = input("Would you like to try again? Y or N?: ")
16+
if ask == "Y":
17+
continue
18+
else:
19+
break
20+
print("Goodbye")
21+

‎MP3 Player.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from replit import audio
2+
import os, time
3+
4+
def play():
5+
source = audio.play_file('audio.wav')
6+
source.paused = False
7+
while True:
8+
stop = int(input("Please Press 2 to stop playback: "))
9+
if stop == 2:
10+
source.paused = True
11+
return
12+
else:
13+
continue
14+
15+
16+
while True:
17+
os.system("clear")
18+
print("Welcome to Joshua's MP3 Player 🎵")
19+
time.sleep(2)
20+
userInput = int(input("Press 1 to PLAY and 2 to STOP: "))
21+
if userInput == 1:
22+
play()
23+
elif userInput == 2:
24+
continue

‎Maths table.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ask = "Y"
2+
while ask == "Y":
3+
print("Interactive Maths table")
4+
number = int(input("Enter your number: "))
5+
for table in range(1, 11):
6+
print(number, "x", table, "=", number * table)
7+
else:
8+
ask = input("Would you like to try again? Y or N?: ")
9+
if ask == "Y":
10+
continue
11+
else:
12+
break
13+
print("Goodbye")
14+
15+

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL