Skip to content

Commit e56d694

Browse files
How To Print in Colors in Python SO SO SO COOL
1 parent 87b8bbc commit e56d694

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

Colors.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#this is so cool
2+
print("\033[1mThis is in white!")
3+
print("\033[95mThis is in pink!")
4+
print("\033[94mThis is in purple!")
5+
print("\033[93mThis is in yellow!")
6+
print("\033[4mThis is in beige!")
7+
print("\033[96mThis is in light blue!")
8+
print("\033[92mThis is in green!")

Functions/SwapWOThirdar.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
assembly=int(input("Enter a value for the assembly variable 2526 328 PROG LANG: "))
2+
pintosfavosofpasclover=int(input("Enter a value for the pintosfavosofpasclover or cs375 fanboy: "))
3+
assembly=assembly+pintosfavosofpasclover
4+
pintosfavosofpasclover=assembly-pintosfavosofpasclover
5+
assembly=assembly-pintosfavosofpasclover
6+
print(assembly)
7+
print(pintosfavosofpasclover)

Kudos.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#global variable
2+
alpha = 5
3+
4+
class Kudos:
5+
#constructor
6+
def __init__(self):
7+
print("This is a constructor")
8+
pass
9+
10+
#class method
11+
def cat(self, food):
12+
self.food = food
13+
print("This cat likes to eat "+food)
14+
15+
# private variable and aka local
16+
alpha = 6
17+
18+
19+
# Creating an instance of the class
20+
kudos = Kudos()
21+
22+
# Calling the class method cat on the instance
23+
kudos.cat("fish")
24+
25+
#Print the local value of alpha which is 6 NOOOT 5
26+
print("This will not get print out and error "+str(kudos.alpha))
27+
28+
# Print the global value of alpha which is 5 because alpha can be accessed by anyone
29+
print(alpha)

makenelanlearnassembly.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
print("The Favorite Programming Languages of 2-56837")
44
for i in favlangs:
55
print(i)
6-
76
print("AAANNDD THE FAVORITE PARADIGM OF 727225 56837")
8-
print(favParadigm[1])
7+
print(favParadigm[0])

0 commit comments

Comments
 (0)