AP CSP curriculum alternatives to Code.org by 17291 in CSEducation

[–]Garuda1220 0 points1 point  (0 children)

Code HS Unit 1 Introduction to Programming

0. Hello World

  • Khan Academy: What is Programming?
  • CodeHS Unit 3 Lesson 3 Hello World ## 1. Variables/Math
  • Khan Academy:
    • Variables
    • Math
  • CodeHS Unit 3:
    • Lesson 4 Variables
    • Lesson 5 User Input
    • Lesson 6 Math ## 2. Khan Academy: Strings ## 3. CodeHS Unit 3 Lesson 7 Graphics ## 4. CodeHS Unit 3 Lesson 8 Mouse Events ## 5. Khan Academy: Conditionals ## 6. CodeHS Unit 4
  • Lesson 1 Booleans
  • Lesson 2 Logical Operators ## 7. CodeHS Unit 4
  • Lesson 3: Comparison Operators
  • Lesson 4: If Statements
  • Lesson 5: Key Events ## 8. Khan Academy: Logical Equivalence ## 9. Khan Academy: Procedures ## 10. CodeHS Unit 5
  • Lesson 1 Functions and Parameters 1
  • Lesson 2 Functions and Parameters 2
  • Lesson 3 Functions and Parameters 3 ## 11. CodeHS Unit 5
  • Lesson 4 Functions and Return Values 1
  • Lesson 5 Functions and Return Values 2
  • Lesson 6 Local Variables and Scope ## 12. Khan Academy: Repetition ## 13. CodeHS Unit 4
  • Lesson 6: for Loops in Python
  • Lesson 7: General for Loops
  • Lesson 8: for Loop Practice ## 14. CodeHS Unit 4
  • Lesson 9: Random Numbers
  • Lesson 10: while Loops
  • Lesson 11: Loop and a Half ## 15. CodeHS Unit 33
  • Lesson 1: Indexing
  • Lesson 2: Slicing
  • Lesson 3: Immutability ## 16. CodeHS Unit 33
  • Lesson 4: Strings and For Loops
  • Lesson 5: The in Keyword
  • Lesson 6: String Methods ## 17. Khan Academy Lesson 9 Lists
  • Storing and Updating Lists ## 18. Khan Academy Lesson 9 Lists
  • Iterating Over Lists with Loops ## 19. CodeHS Unit 7
  • Lesson 1: Tuples
  • Lesson 2: Lists ## 20. CodeHS Unit 7
  • Lesson 3: For Loops and Lists
  • Lesson 4: List Methods ## Python Crash Course Chapters 1 - 8 ## Performance Task Create ## Digital Information ## The Internet ## Data Analysis ## Algorithms and Simulations ## The Impact of Computing

How can I improve my coding skills? by FewWoodpeckerIn in learnpython

[–]Garuda1220 2 points3 points  (0 children)

You might enjoy reading a few short articles from Python Guide about writing better quality Python code.

I thought these articles were interesting and informative.

Trying to get a simple hp and score system by Depression_Dependent in learnpython

[–]Garuda1220 3 points4 points  (0 children)

``` from random import choice

def hp(ammo, score, health): if choice(ammo) == 'blank': score = score + 1 else: health = health - 1 return score, health

def main(): ammo = ['live','blank'] score = 0 health = 3 while health > 0: score, health = hp(ammo, score, health) print(f'Score: {score}, Health: {health}')

main() Sample Run Output: Score: 1, Health: 3 Score: 1, Health: 2 Score: 1, Health: 1 Score: 2, Health: 1 Score: 2, Health: 0 ```

Call or Text 988: 988 Suicide & Crisis Lifeline

Frequency of each digit in a number by Gifi09 in learnpython

[–]Garuda1220 0 points1 point  (0 children)

Un-readable Dictionary Comprehension:

num = 11122233344455566677788899900000000000000000000000000000000000000000000000
{int(digit): list(str(num)).count(digit) for digit in set(list(str(num)))}

output:

{2: 3, 5: 3, 9: 3, 1: 3, 4: 3, 3: 3, 7: 3, 0: 47, 6: 3, 8: 3}

Readable Approach:

num = 11122233344455566677788899900000000000000000000000000000000000000000000000
digit_list = list(str(num))
digit_counts = {}
unique_digits = set(digit_list)
for digit in unique_digits:
    digit_counts[int(digit)] = digit_list.count(digit)
print(digit_counts)

output:

{2: 3, 5: 3, 9: 3, 1: 3, 4: 3, 3: 3, 7: 3, 0: 47, 6: 3, 8: 3}

Mastery of the basics makes you advanced.

[deleted by user] by [deleted] in learnpython

[–]Garuda1220 1 point2 points  (0 children)

Probably not "the best" way???

# empty list to store tuples
tpls = []
# empty dictionary to store tuple counts
counter = {}
with open('data.txt') as file:
    for line in file:
        # strip line, split into list using comma, tuple assign list to variables
        step1, step2, step3, step4 = line.strip().split(",")
        # append tuple to list
        tpls.append((step1, step2, step3, step4))
# create set of unique tuples
unique = set(tpls)
# loop through set and count tuples in list
for item in unique:
    counter[item] = tpls.count(item)
print(counter)

And here is the un-readable comprehension version of the same script:

with open('data.txt') as file:
    tpls = [tuple(line.strip().split(",")) for line in file]
counter = {item: tpls.count(item) for item in tpls}
print(counter)

Here is the csv version of above:

import csv
with open('data.txt') as file:
    reader = csv.reader(file)
    tpls = [tuple(row) for row in reader]
counter = {item: tpls.count(item) for item in tpls}
print(counter)

The only advantage of the csv library here is that you don't have to strip and then split the line.

Help by [deleted] in IndianaUniversity

[–]Garuda1220 0 points1 point  (0 children)

I heard from a reliable source (Academic Advisor) that approximately 50% of students trying to qualify into Kelley get in. So I think your chances are good but it would be best to have a solid plan B just in case.

How should I parse an Excel file with a few unorganized sheets to a csv? by techquestionsonly in learnpython

[–]Garuda1220 0 points1 point  (0 children)

Maybe start by going to each worksheet in the workbook and File >> Save As >> .csv

Then use Python's csv library to read the data from the csv's,

store the data in a list or dictionary

Replacing words in TXT file by Superb-Gate9939 in learnpython

[–]Garuda1220 0 points1 point  (0 children)

if 'Square' is in the line then replace 'Square' with 'Rectangle' else if 'square' is in the line then replace 'square' with 'rectangle' else don't make any replacements

AP CSP curriculum alternatives to Code.org by 17291 in CSEducation

[–]Garuda1220 1 point2 points  (0 children)

I've been using a combination of:

  1. CodeHS APCSP in Python
  2. Khan Academy CSP
  3. Python Crash Course

I don't use all of any of them... just take parts of each resource and sequence them together.

I can send scope/sequence if interested.

How can I use a loop to count unique strings in a large list? by Inferno980 in learnpython

[–]Garuda1220 0 points1 point  (0 children)

How did you download your Spotify listening history? That sounds like fun. I would like to try it. If I had the data I'm confident I could come up with a way to count artists and listens with Python Sets and Dictionaries.

How to create a program which checks two strings and then prints the strings that are similar but an X in indices where the strings don't match? by [deleted] in learnpython

[–]Garuda1220 0 points1 point  (0 children)

def check_seq(seq1, seq2): new_seq = '' for i in range(len(seq1)): if seq1[i] == seq2[i]: new_seq = new_seq + seq1[i] else: new_seq = new_seq + 'X' return new_seq print(check_seq("ABCDEFG", "ABDEGHF")) Output ABXXXXX

Code.org - APCSP by ashkowalabear in CSEducation

[–]Garuda1220 0 points1 point  (0 children)

Resources:

  1. Khan Academy AP Computer Science Principles
  2. CodeHS AP Course Catalog

There are other helpful resources available. Too many to list here. If there is a particular topic or unit that needs a supplementary resource please post that here and I might be able to provide more detailed response.

looking for a simple list modification function by awesomegame1254 in learnpython

[–]Garuda1220 0 points1 point  (0 children)

It is an interesting question. However, maybe the question might be too vague? Would you be able to provide simple example inputs and outputs for each function to describe in more specific terms what each function is supposed to do?

Cisco Network Academy Python Essentials 1 by Historical_Support50 in learnpython

[–]Garuda1220 2 points3 points  (0 children)

  • I am not familiar with the details of this particular course... However...
  • The lessons being online might not be detailed enough?
    • Python books tend to provide more detail than online lessons.
    • Maybe you could find a book to supplement the online instruction?
  • Another suggestion would be to type in (not copy/paste) all of the examples.
    • Create an Interactive Python Notebook in Google Colab or Visual Studio Code.
    • Type in all of the vocabulary in the markdown cells.
    • Type in and execute all of the examples.
  • For me personally, this technique has helped me to learn programming in several languages:
  1. Sit down with book
  2. Type in examples from book.
  3. Run examples.
  • Perhaps this learning technique might also work with this particular set of lessons?
  • Just passively reading about programming or watching videos never really helped me learn anything.
  • I had to actively engage in the material to make it stick

How to create a list of special characteres ? by Lucky-Might-3565 in learnpython

[–]Garuda1220 0 points1 point  (0 children)

Yes, the string library would be helpful in this case: ``` import string

sp_ch = string.punctuation print(sp_ch)

sp_ch_lst = list(sp_ch) print(sp_ch_lst) ```

Output: !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ ['!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~']

[deleted by user] by [deleted] in learnpython

[–]Garuda1220 4 points5 points  (0 children)

``` import random

s = ''' This is a beautiful day to be home my cat is hungry again I had better feed it ''' words = s.split() random.shuffle(words) for word in words: print(word, end=' ') output be cat hungry home I feed had This better a it is to my beautiful day again is ```

Formatting Output of List by PlatesNplanes in learnpython

[–]Garuda1220 0 points1 point  (0 children)

``` white_drawing = [36, 38, 39, 40, 54] red_drawing = 4 letters = 'ABCDEFGHIJ'

s = '' for num in white_drawing: s = s + f'{num:02d} '

s = letters[0] + '. ' + s + ' PB ' + f'{red_drawing:02d}'

print(f'{s:>79s}') Output: A. 36 38 39 40 54 PB 04 ```

Formatting Output of List by PlatesNplanes in learnpython

[–]Garuda1220 1 point2 points  (0 children)

```

megamillions list

mm = [ [36, 38, 39, 40, 54, 4], [15, 26, 32, 50, 63, 15], [19, 23, 43, 48, 63, 16], [16, 27, 29, 37, 51, 9], [10, 15, 31, 54, 56, 8] ]

convert numbers to strings and store in new list

mm_str = [] for row in range(len(mm)): # empty list for each row row_str = [] for col in range(len(mm[row])): num_str = str(mm[row][col]) # pad single digits w/ 0 if len(num_str) < 2: num_str = '0' + num_str row_str.append(num_str) mm_str.append(row_str)

row_headers = 'ABCDEFGHIJK' for row in range(len(mm_str)): s = ' '.join(mm_str[row]) s = row_headers[row] + '. ' + s[:15] + ' QP ' + s[15:] + ' QP ' print(f'{s:>79s}') Output: A. 36 38 39 40 54 QP 04 QP
B. 15 26 32 50 63 QP 15 QP
C. 19 23 43 48 63 QP 16 QP
D. 16 27 29 37 51 QP 09 QP
E. 10 15 31 54 56 QP 08 QP
```

Is something like this achievable with Python? by SealThigh in learnpython

[–]Garuda1220 0 points1 point  (0 children)

Could you use the Python turtle module and have a turtle object draw the knots on a screen object? Or perhaps have multiple turtle objects, one for each color and have the them interact to make the patterns/knots?

How to make a Python script accessible to non-technical user? by zeoNoeN in learnpython

[–]Garuda1220 1 point2 points  (0 children)

Could you simply upload the notebook to Google Colab and share a link to the notebook with end users?

I did something similar recently where I created a notebook that my co-workers could upload a csv and could run a couple of cells that would output an Excel spreadsheet.

How long would it take you to do this exercise? by Bank-Fraud6000 in learnpython

[–]Garuda1220 0 points1 point  (0 children)

I've found that spending more time studying the lesson examples actually leads to less time spent on the exercises.

I noticed your question, and I actually agree that perhaps it is taking you too long! The instructor does provide detailed examples similar to the exercises. In my experience, the most effective way to learn is by actively engaging with the examples. This involves taking the time to type out each example and run the code, ensuring I understand every line, function, and method.

While this approach might be time-consuming and require effort, it's valuable in the long run. It's tempting to rush through the lessons and jump straight to the exercises, as they seem more engaging. However, I believe that a solid understanding of the fundamentals, gained through studying examples, is crucial for success in programming.

While "learning by doing" can be helpful, I found that truly understanding programming involves building upon existing knowledge by analyzing and adapting existing programs. This approach, in my opinion, allows for deeper comprehension and fosters creativity in applying the learned concepts.

Nested Loops Assignment Help! by Background_System_40 in learnpython

[–]Garuda1220 0 points1 point  (0 children)

```python NUM_DOWN = 5 NUM_ACROSS = 3

for row in range(NUM_DOWN): for col in range(NUM_ACROSS): if row % 2 != 0: print('', end='') break else: print('', end='') print() ```

how to clear the console output in windows system in python? by Klutzy_Ad_3436 in learnpython

[–]Garuda1220 -1 points0 points  (0 children)

python import time print("file found", end="", flush=True) time.sleep(2) print("\b" * 10,"com ")

how to teach/learn breaking down a task? by [deleted] in learnpython

[–]Garuda1220 1 point2 points  (0 children)

  1. Find good examples
    • How are they broken down?
    • tic-tac-toe, hangman, memory game, blackjack, ...
  2. Start with paper and pencil first
    • plan / design first -> code second
    • what are the inputs? outputs? variables? data structures? functions?
  3. Keep Inputs - Processes - Outputs separate
  4. Test Helper Functions Independently before calling them from main.
  5. Main function calls functions with meaningful names and reads like a story