top of page

Forum Posts

Shravya S
Jul 23, 2023
In Introduction to Python
Hey -- the homework was previously formatted wrong here (but not on the slides). Sorry about that! Homework: Resources: Slides: https://docs.google.com/presentation/d/15pk3Pma_64ogttIfLwt8pv3Dqg2kr5vKQpiftlM-9T8/edit?usp=sharing Code: https://replit.com/join/pyvaiysnho-shrav816 Contact: shravyassathish@gmail.com (mentor) mailtoarnavpandey@gmail.com (TA) Make sure to "Add a comment" with your code to the homework in order to submit your homework assignment! Recordings for the class have been sent out through email :)
Introduction to Python 7/19 - Week 6 Homework content media
0
8
54
Shravya S
Mar 27, 2023
In Introduction to Python
No homework -- thanks for joining us in this course! Resources: Slides: https://docs.google.com/presentation/d/1KNUMXlpj0hWpVTH2SSzWTm1Gb1drvpGnW6uD59ZsTOY/edit?usp=sharing Code: https://replit.com/join/imdpddeaua-shrav816 Conway's Game of Life Final Code: https://replit.com/join/mqwbxvmlag-shrav816 If you were wondering why the Conway's Game of Life code didn't work at the end of class, I was actually just missing an indent before line 24. Don't forget your spacing, I suppose. Also, I scaled the grid size down from 100x100 to 50x50 to make each cell more visible. Contact Info: shravyassathish@gmail.com (mentor) kingericwu@gmail.com (TA) felixguo41@gmail.com (TA)
0
1
25
Shravya S
Mar 05, 2023
In Introduction to Python
Create the appropriate graphs. Label the axis and give each graph a title. Bar chart: Lily wants to compare the colors of each of her toy cars. She has 8 red cars, 10 blue cars, and 6 green cars. Line graph: There are two coffee shops. Here are the prices for coffee at Shop A over the course of 6 years: $2.50, $2.75, $3.15, $2.90, $3.50, $3.80. Here are the prices at Shop B over the course of 6 years: $3.00, $3.00, $3.15, $2.85, $2.90, $3.00. Make each point on the Shop A graph red and each point on the Shop B graph blue. Histogram: Plot the amount of sleep students got last night: [5, 6, 6, 6, 9, 10, 7, 5, 9, 8, 6, 10, 7, 7, 8, 4, 8, 8, 9, 6, 8, 3] Resources: Slides: https://docs.google.com/presentation/d/1eRoquvh6-CjUHu_kN2sPDS6nDkJwkvkTp6taNxHkBdI/edit?usp=sharing Code: https://replit.com/join/hrliwrxwgl-shrav816 Contact Info: shravyassathish@gmail.com (mentor) kingericwu@gmail.com (TA) felixguo41@gmail.com (TA)
0
0
17
Shravya S
Nov 22, 2022
In Introduction to Python
Use recursion to determine the nth term of an arithmetic series. Parameters: starting term, common difference, n. The formula for the nth term is an = an - 1 + d. Write a lambda that checks if a tuple of integers is a square. Resources: Class slides: https://docs.google.com/presentation/d/1iC-GsI2-bK96kdQ32hbrf3g2BuOeObFAIWCFFZOsop4/edit?usp=sharing Class code: https://replit.com/join/ywxsbaugeu-shravyas Contact Info: shravyassathish@gmail.com (mentor) kingericwu@gmail.com (TA) felixguo41@gmail.com (TA)
0
3
33
Shravya S
Aug 04, 2022
In Introduction to Python
Homework: None! Today is the last class. Resources: Class slides: https://docs.google.com/presentation/d/1Ny2ad5hPuoNFRriRWdtzLYvXXt-LdFYnFlNnYpfUEoY/edit?usp=sharing Class code: https://replit.com/join/mddurqtsmb-shravyas What we finished of Pokemon Attack in class: https://replit.com/join/njbkmizzsv-shravyas Finished Pokemon Attack: https://replit.com/join/xlmxmuwzpe-shravyas Thank you for attending Intro to Python! You can always email us at shravyassathish@gmail.com (mentor) or kingericwu@gmail.com (TA) or message us on Discord if you have any questions about what we covered in class or anything in the future.
0
0
15
Shravya S
Jul 16, 2022
In Introduction to Python
HOMEWORK: Math expressions: Write and calculate these expressions in Python. e^5 Ceiling function of the square root of 127 Card exercise Create a tuple to represent the four suits of cards (hearts, diamonds, spades, and clubs), and another tuple for 13 possible values (2 - 10, J, Q, K, A). Iterate over all possible cards. Using the random module, deal three random cards. Sets Take input for the elements of a set (space-separated integers). Create the set, and then create another set. Print the intersection/elements in common. RESOURCES: Class slides: https://docs.google.com/presentation/d/1PTxphkoJcpzyN2h4qDsyk-6SG7_OzQCOC8G2w0CFYP8/edit?usp=sharing Battleship code: https://replit.com/join/hlutbjbnyh-shravyas Class example code: https://replit.com/join/uvyjosgvrd-shravyas Coding platform: replit.com Post your answers as a comment! I will post the solution before next class. You can always email us at shravyassathish@gmail.com (mentor) or kingericwu@gmail.com (TA) or message us on Discord if you have any questions about the homework or what we covered in class.
0
1
19
Shravya S
Jun 30, 2022
In Introduction to Python
HOMEWORK: Finish your battleship project code. Here are the requirements for what it should be able to do: Show the proper coordinate grid. Show the number of turns remaining. Accept user input. Check if it is your nested list -- ships. Either print "hit" or "miss". End the program after five turns. Extra features: Don't allow duplicate guesses. For this, you'll need a nested list that appends each of the guesses. Then, check if every new guess is in this guess list (like checking against the ships list). Handle out-of-bounds cases. For example, if the player guesses [6, 8], it should say their coordinates need to be from 0 to 4. End before five turns if the player guesses all of the ships. Multiple approaches -- easiest one is to have a counter for ships found and check if that has reached a certain threshold. RESOURCES: Class slides: https://docs.google.com/presentation/d/1r1J1ArzL7Xyv1ifIxuNHqwSwGNrpt7QUx3QM0W2IXCU/edit?usp=sharing Class code: https://replit.com/@ShravyaS/BattleshipGame#main.py (This code is different from my answer key, so it doesn't include extra features/isn't the most organized. It's what we typed in class!) Post your answers as a comment! Solutions will be up soon. You can always email us at shravyassathish@gmail.com (mentor) or kingericwu@gmail.com (TA) or message us on Discord if you have any questions about the homework or what we covered in class.
0
1
32
Shravya S
Jun 28, 2022
In Introduction to Python
HOMEWORK: RESOURCES: Class slides: https://docs.google.com/presentation/d/1534SMu5WLajXYbIoYIGkOAQ5QEUzWNbWYDskVvz9SGY/edit?usp=sharing Code: https://replit.com/@ShravyaS/IntroToPython-Wk3Day2#main.py Post your answers as a comment! Solutions will be up soon. You can always email us at shravyassathish@gmail.com (mentor) or kingericwu@gmail.com (TA) or message us on Discord if you have any questions about the homework or what we covered in class.
6/26 - Homework Week 3 Day 2 content media
0
2
38
Shravya S
Jun 12, 2022
In Introduction to Python
RESOURCES: Class slides: https://docs.google.com/presentation/d/1kY_YhPN9f8OI-mVB-gzk6ukoakYycvhzds_2g96ofIk/edit?usp=sharing Code from class: https://replit.com/@ShravyaS/IntroToPython-Wk1Day2 Coding platform: replit.com HOMEWORK: Write a program that takes two inputs and stores them in variables feet and inches. Print output of their height in only inches. (12 inches = 1 foot) Using the six comparison operators and three logical operators, write two expressions that are true and two expressions that are false. Post your answers as a comment! Solutions will be posted later (we'll also go over it next class). Feel free to email shravyassathish@gmail.com (mentor) or kingericwu@gmail.com (TA) if you're stuck or have questions! See you :)
0
12
81
Shravya S
Jun 09, 2022
In Introduction to Python
RESOURCES: Class slides: https://docs.google.com/presentation/d/1zIPSvXFg7eEVjguovCNHKpuojvqCq6eA5tjJpfGnSKc/edit?usp=sharing Coding platform: replit.com Discord: https://discord.gg/FKKAcmrr HOMEWORK: Give 3 examples of each data type (2 examples for Booleans). Take user input and tell an interactive story using f-strings and concatenation of variables and print statements. Example of a starting point: username = input(“What is your name?”) print(username + “, you know my name, not my story”) Post your answers as a comment! Solutions will be posted later. Feel free to email shravyassathish@gmail.com (mentor) or kingericwu@gmail.com (TA) if you're stuck or have questions! See you next class :)
0
15
82
Shravya S
Apr 05, 2022
In Introduction to Python
RESOURCES: Classwork: Classwork answers: https://replit.com/@ShravyaS/IntroToPython-23#main.py NO HOMEWORK! This week (4/5) is the last class! See you then!
3/29 - Class 23 Resources content media
0
0
22
Shravya S
Mar 30, 2022
In Introduction to Python
RESOURCES: Class slides: https://docs.google.com/presentation/d/1cSvNqmidHLZvFANjvwYt65A563Qu2LI8MPt52yozQHs/edit?usp=sharing Example code: https://replit.com/@ShravyaS/IntroToPython-22 HOMEWORK: Create and design a custom class. You can use anything except the in-class example that I programmed with (car), but make sure you use 3 attributes and 2 methods at least. Write your answer as a comment, and feel free to email the TAs (Shravya and Eric) if you're stuck. See you next class!
0
0
21
Shravya S
Mar 20, 2022
In Introduction to Python
RESOURCES: Class slides: https://docs.google.com/presentation/d/10LqX5iltZ8boe6rpdhn7wuwLZcNjsQDA9jvhS_fNAGs/edit?usp=sharing Example code: https://replit.com/@ShravyaS/IntroToPython-21 HOMEWORK: Write a program that that takes in several numbers. Store them in a list and use slicing to print out every odd indexed number (indexes 1, 3, 5, …), every index that is a multiple of 3 (indexes 0, 3, 6, …) and every index that is a multiple of 5 (indexes 0, 5, 10, …) Write your answer as a comment, and feel free to email the TAs (Shravya and Eric) if you're stuck. See you next class!
0
1
17
Shravya S
Mar 15, 2022
In Introduction to Python
RESOURCES: Class slides: https://docs.google.com/presentation/d/1Tl0DfU3mn-KnBnjzLnZoHtzr2vujPMQgdehusWt2rXw/edit?usp=sharing HOMEWORK / MINI-PROJECT: Create a program that simulates a standard deck of cards without Jokers. There are 4 suits of cards (Clubs, Diamonds, Hearts, Spades), each with 13 cards: Jack, Queen, King, Ace, and the numbers 2 through 10. This makes for a total of 4*13 = 52 cards. Your program should also keep track of one person's hand as well as a deck of cards, and the sum of the cards in the deck and that person's hand should of course be 52. Allow the user to draw cards into the person's hand, shuffle the deck, print out the cards in deck or in hand, etc. through commands entered through input. (Implement a draw function with a number of cards to draw, a shuffle function, printing for the hand/deck.) Create a card game with the existing code for this project, like Blackjack, Big 2, etc. I recommend having the game be a "pass-around" system, so every player in the card game has their own hand and enters input through the program. Write your answer as a comment, and feel free to email the TAs (Shravya and Eric) if you're stuck. See you on Tuesday!
0
1
8
Shravya S
Feb 28, 2022
In Introduction to Python
Sorry for the late post! RESOURCES: Class slides: https://docs.google.com/presentation/d/1yrk3igZ4omIMSG75CpmHoTUfd76rVysXkWosLrgmK_Q/edit?usp=sharing HOMEWORK / MINI-PROJECT: Write a program that acts as a basic "password manager." The program should store passwords for several different services and be able to set or retrieve passwords. For instance, "get google.com" should return the current password set for "google.com," and "set google.com xyz" would set the password for "google.com" as "xyz." Write your answer as a comment, and feel free to email the TAs (Shravya and Eric) if you're stuck. See you on Tuesday!
0
1
26
Shravya S
Feb 11, 2022
In Introduction to Python
RESOURCES: Class slides: https://docs.google.com/presentation/d/17bTKwj8HQCmq1EYbqcVSvHgdymNR0GSEsGLoUmmK5Gc/edit?usp=sharing Example code: https://replit.com/@ShravyaS/IntroToPython-18 HOMEWORK / MINI-PROJECT: (Same as Class 16; use DICTIONARIES, not LISTS) Write a program that can accept menu items and menu prices, until the word "done" is entered. Store each item and price in a dictionary. Then, print out everything together as a fancy menu. ex: duck 35 chopsticks 10 done duck . . . . . . $35 chopsticks . . . . . . $10 Write your answer as a comment, and feel free to email the TAs (Shravya and Eric) if you're stuck. See you next class!
0
3
28
Shravya S
Jan 30, 2022
In Introduction to Python
RESOURCES: Class slides: https://docs.google.com/presentation/d/1kmWz86R6X1BuYi3Z952yiPgmlvWuow9KU0RXoCkKK8w/edit?usp=sharing Example code: https://replit.com/@ShravyaS/IntroToPython-16 (This contains the solution to the mini-project and more information about tuples, so if you need help with dictionaries, just email me at shravyassathish@gmail.com :)) HOMEWORK / MINI-PROJECT: Write a program that can accept menu items and menu prices, until the word "done" is entered. Store each item and price in a dictionary. Then, print out everything together as a fancy menu. ex: duck 35 chopsticks 10 done duck . . . . . . $35 chopsticks . . . . . . $10 Write your answer as a comment, and feel free to email the TAs (Shravya and Eric) if you're stuck. See you next class!
0
2
26
Shravya S
Jan 16, 2022
In Introduction to Python
RESOURCES: Class slides: not added yet! Example code: https://replit.com/@ShravyaS/IntroToPython-15 HOMEWORK / MINI-PROJECT: Same as last week! See https://www.lol-101.com/classrooms/introduction-to-python/1-4-class-14-hw-resources. Write your answer as a comment, and feel free to email the TAs (Shravya and Eric) if you're stuck. See you next class!
0
1
33
Shravya S
Jan 08, 2022
In Introduction to Python
Happy late New Year, and welcome back after winter break! :) RESOURCES: Class slides: https://docs.google.com/presentation/d/16-34_-argpSG1VIpp5Xvm-h-cjjuugiq_whAsP6jgG0/edit?usp=sharing Example code: https://replit.com/@ShravyaS/IntroToPython-14 HOMEWORK / MINI-PROJECT: Create a program that simulates a standard deck of cards without Jokers. There are 4 suits of cards (Clubs, Diamonds, Hearts, Spades), each with 13 cards: Jack, Queen, King, Ace, and the numbers 2 through 10. This makes for a total of 4*13 = 52 cards. Your program should also keep track of one person's hand as well as a deck of cards, and the sum of the cards in the deck and that person's hand should of course be 52. Allow the user to draw cards into the person's hand, shuffle the deck, print out the cards in deck or in hand, etc. through commands entered through input. (Implement a draw function with a number of cards to draw, a shuffle function, printing for the hand/deck.) Enhancement ideas: keep track of 4 (or more) players' hands, print out the cards as little ASCII drawings, implement a simple card game with these functions. Write your answer as a comment, and feel free to email the TAs (Shravya and Eric) if you're stuck. See you next class!
0
2
31
Shravya S
Dec 15, 2021
In Introduction to Python
RESOURCES: Class slides: https://docs.google.com/presentation/d/1AXVYWIXesdnNct0KtiCi_ZZn6Kz72HKJbh4VH6BRmHY/edit?usp=sharing Example code: https://replit.com/@ShravyaS/IntroToPython-13 HOMEWORK: Create a list to store several inputs. Then, take in input until the word "STOP" is entered. Store each input apart from "STOP" in the list, and then print out the contents of the list backward. Write your answer as a comment, and we’ll post the solution by the next class. See you then!
0
2
39

Shravya S

Forum Moderator
More actions
bottom of page