![:octocat: :octocat:](https://github.githubassets.com/images/icons/emoji/octocat.png)
- https://www.youtube.com/channel/UCe1gZh7Pa8KtIBudbqkMfdA
- https://www.youtube.com/@Compuscience-Python-Prog-Exps/community
- https://youtube.com/playlist?list=PL-Jc1Yxezi_QFx7KmT-BeDoFnlH-bdUkF&si=VxZCQjs5m2knoxmA
- https://youtube.com/playlist?list=PL-Jc1Yxezi_To307LogWqMwn3KGNBMGPG&si=FfpCW94CJpACQUZ7
- https://youtube.com/playlist?list=PL-Jc1Yxezi_ShdaaEPE3mSawOt79ewUPZ&si=0nTIng9vsqfXSFME
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
# Created by Joseph C. Richardson, GitHub.com | |
class My_Shapes: | |
def __init__(self,shape,sides): | |
self.shape=shape | |
self.sides=sides | |
def shape_sides(self): | |
return f'a {self.shape} has {self.sides}.\n' |
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
# Created by Joseph C. Richardson, GitHub.com | |
set1,set2=( | |
{'1','1','2','3','4','4','5','6','7','8','9','10'}, | |
{'A','B','C','D','E','E','F','G','H','H','I','J'} | |
) | |
convert1,convert2=list(set1),list(set2) | |
convert1,convert2=sorted(convert1),sorted(convert2) | |
convert1.extend(convert2) |
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
# Create four packed sets, then convert them into packed and sorted, extended lists. | |
# Check to see if their values are all sorted and reversed. After that, reconvert the | |
# 'convert1' list back into a very long extended unsorted, unpacked set. Type and | |
# execute/run the program example below and see what happens. | |
# Created by Joseph C. Richardson, GitHub.com | |
set1,set2,set3,set4=( | |
{1,2,3,4,5,6,7,8,9,10,4,2,10}, | |
{'1','1','2','3','4','4','5','6','7','8','9','10','20'}, |
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
# Created by Joseph C. Richardson, GitHub.com | |
auto_int=[] | |
for i in range(48,58): | |
auto_int.append(chr(i)) | |
print(auto_int) | |
print(f'\nYou have {len(auto_int)} items in your "auto_int" list.\n') | |
auto_abc_lower=[] |
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
# Try these Robomaster S1 Led sets. Play around with the different functions and see what they do. | |
# Created by Joseph C. Richardson, GitHub.com | |
led=led_ctrl | |
define=rm_define | |
delay1,delay2,delay3,delay4=.1,.001,4,1 | |
l1,l2=0,255 | |
def start(): |
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
# Created by Joseph C. Richardson, GitHub.com | |
media_ctrl.play_sound(rm_define.media_sound_solmization_3B) | |
media_ctrl.play_sound(rm_define.media_sound_solmization_3A) | |
media_ctrl.play_sound(rm_define.media_sound_solmization_3G) | |
media_ctrl.play_sound(rm_define.media_sound_solmization_3F) | |
media_ctrl.play_sound(rm_define.media_sound_solmization_3E) | |
media_ctrl.play_sound(rm_define.media_sound_solmization_3D) | |
media_ctrl.play_sound(rm_define.media_sound_solmization_3C) | |
media_ctrl.play_sound(rm_define.media_sound_solmization_2B) |
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
# I learned this from a Python Youtuber, named Mosh. I only kept the start and stop parts of the program, so we can all | |
# learn how it works. It's pretty tricky looking. I'm still not always sure where to place my 'not' and such. lol | |
# Created by Joseph C. Richardson, GitHub.com | |
start=False | |
while True: | |
command=input('SPACECRAFT\n').lower().strip() | |
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
# Here is one I created, which is also very useful to know. I hope you agree?-:) | |
# C adds up to 5555. I also created a set unpacking example, which has outer brackets | |
# that surround the actual packed sets, a and b. The a and the b get unionized and c | |
# is the SUM of the two converted sets, which now becomes a sorted, non-randomized | |
# non-duplicated listed printout instead. | |
# Created by Joseph C. Richardson, GitHub.com | |
a,b=( | |
{1,1,2,3,4,5,6,7,8,9,10}, |
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
# Sometimes if you are going to be using and reusing small bits of Python code | |
# over and over again, you might want to consider using the 'exec' function. | |
# The 'exec' function can be used in such examples as these examples below. | |
# Created by Joseph C. Richardson, GitHub.com | |
redundant_code=''' | |
print("Python Programmer's Glossary Bible") | |
print('This block of code can be used and reused again and again.') | |
''' |
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
'''Save the Python file as 'OS screen colours''' | |
# There are OS screen colours, which colours text. These OS screen colour | |
# codes colour individual text characters. See program examples below. | |
# Created by Joseph C. Richardson, GitHub.com | |
import os | |
os.system('') |
OlderNewer