-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
How To Print in Colors in Python SO SO SO COOL
- Loading branch information
1 parent
87b8bbc
commit e56d694
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#this is so cool | ||
print("\033[1mThis is in white!") | ||
print("\033[95mThis is in pink!") | ||
print("\033[94mThis is in purple!") | ||
print("\033[93mThis is in yellow!") | ||
print("\033[4mThis is in beige!") | ||
print("\033[96mThis is in light blue!") | ||
print("\033[92mThis is in green!") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
assembly=int(input("Enter a value for the assembly variable 2526 328 PROG LANG: ")) | ||
pintosfavosofpasclover=int(input("Enter a value for the pintosfavosofpasclover or cs375 fanboy: ")) | ||
assembly=assembly+pintosfavosofpasclover | ||
pintosfavosofpasclover=assembly-pintosfavosofpasclover | ||
assembly=assembly-pintosfavosofpasclover | ||
print(assembly) | ||
print(pintosfavosofpasclover) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#global variable | ||
alpha = 5 | ||
|
||
class Kudos: | ||
#constructor | ||
def __init__(self): | ||
print("This is a constructor") | ||
pass | ||
|
||
#class method | ||
def cat(self, food): | ||
self.food = food | ||
print("This cat likes to eat "+food) | ||
|
||
# private variable and aka local | ||
alpha = 6 | ||
|
||
|
||
# Creating an instance of the class | ||
kudos = Kudos() | ||
|
||
# Calling the class method cat on the instance | ||
kudos.cat("fish") | ||
|
||
#Print the local value of alpha which is 6 NOOOT 5 | ||
print("This will not get print out and error "+str(kudos.alpha)) | ||
|
||
# Print the global value of alpha which is 5 because alpha can be accessed by anyone | ||
print(alpha) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters