/r/learnprogramming
A subreddit for all questions related to programming in any language.
If you need help debugging, you must include:
See debugging question guidelines for more info.
Many conceptual questions have already been asked and answered. Read our FAQ and search old posts before asking your question. If your question is similar to one in the FAQ, explain how it's different.
See conceptual questions guidelines for more info.
Follow reddiquette: behave professionally and civilly at all times. Communicate to others the same way you would at your workplace. Disagreement and technical critiques are ok, but personal attacks are not.
Abusive, racist, or derogatory comments are absolutely not tolerated.
See our policies on acceptable speech and conduct for more details.
When posting some resource or tutorial you've made, you must follow our self-promotion policies.
In short, your posting history should not be predominantly self-promotional and your resource should be high-quality and complete. Your post should not "feel spammy".
Distinguishing between tasteless and tasteful self-promotion is inherently subjective. When in doubt, message the mods and ask them to review your post.
Self promotion from first time posters without prior participation in the subreddit is explicitly forbidden.
Do not post questions that are completely unrelated to programming, software engineering, and related fields. Tech support and hardware recommendation questions count as "completely unrelated".
Questions that straddle the line between learning programming and learning other tech topics are ok: we don't expect beginners to know how exactly to categorize their question.
See our policies on allowed topics for more details.
Do not post questions that are an exact duplicate of something already answered in the FAQ.
If your question is similar to an existing FAQ question, you MUST cite which part of the FAQ you looked at and what exactly you want clarification on.
Do not delete your post! Your problem may be solved, but others who have similar problems in the future could benefit from the solution/discussion in the thread.
Use the "solved" flair instead.
Do not request reviews for, promote, or showcase some app or website you've written. This is a subreddit for learning programming, not a "critique my project" or "advertise my project" subreddit.
Asking for code reviews is ok as long as you follow the relevant policies. In short, link to only your code and be specific about what you want feedback on. Do not include a link to a final product or to a demo in your post.
You may not ask for or offer payment of any kind (monetary or otherwise) when giving or receiving help.
In particular, it is not appropriate to offer a reward, bounty, or bribe to try and expedite answers to your question, nor is it appropriate to offer to pay somebody to do your work or homework for you.
All links must link directly to the destination page. Do not use URL shorteners, referral links or click-trackers. Do not link to some intermediary page that contains mostly only a link to the actual page and no additional value.
For example, linking to some tweet or some half-hearted blog post which links to the page is not ok; but linking to a tweet with interesting replies or to a blog post that does some extra analysis is.
Udemy coupon links are ok: the discount adds "additional value".
Do not ask for help doing anything illegal or unethical. Do not suggest or help somebody do something illegal or unethical.
This includes piracy: asking for or posting links to pirated material is strictly forbidden and can result in an instant and permanent ban.
Trying to circumvent the terms of services of a website also counts as unethical behavior.
Do not ask for or post a complete solution to a problem.
When working on a problem, try solving it on your own first and ask for help on specific parts you're stuck with.
If you're helping someone, focus on helping OP make forward progress: link to docs, unblock misconceptions, give examples, teach general techniques, ask leading questions, give hints, but no direct solutions.
See our guidelines on offering help for more details.
Ask your questions right here in the open subreddit. Show what you have tried and tell us exactly where you got stuck.
We want to keep all discussion inside the open subreddit so that more people can chime in and help as well as benefit from the help given.
We also do not encourage help via DM for the same reasons - that more people can benefit
Do not ask easily googleable questions or questions that are covered in the documentation.
This subreddit is not a proxy for documentation or google.
We do require effort and demonstration of effort.
This includes "how do I?" questions
/r/learnprogramming
I’m a student who just got a computer for the first time. While I know how to use basic tools like Word and Excel, I have absolutely no experience with programming. I haven’t watched any tutorials on YouTube yet because I’m afraid of starting with the wrong approach and getting stuck.
I like to understand things from the ground up. For example, I want to know:
What is a program? Why are there so many programming languages? What does each tool do?
I’ll be starting university in a year, where I’ll need to learn Python, C++, and Java. I’m not particularly smart, but I’m willing to work hard and really love learning things when they’re explained simply and thoroughly.
Can anyone suggest:
Thanks! :)
I saw a post earlier that said that someone was looking for friends in programming. I would like to have programmer friends. I'm a teen and I've programmed for about a year, with python being main and a little c++ on the side. I'm into tech like arch linux, I use neovim, alt keyboard layout etc.I'm looking for like minded individuals who are into programming, preferably python or C++ to make a project together or something. Disclaimer, I don't know how to use git for a project. You can reach out in the comments and we can go from there, thanks.
Hello!
I am working on my thesis project, and I need real-time ( or at the very least weekly , or maybe monthly if I get desperate ) data updates on the average fuel price ( diesel, gas ) in every country in the European Union and if possible the United Kingdom.
Does anyone know of such an API? Ideally if it is open-source and free, or has many free calls per month, or if it has an affordable pricing plan for a student.
Thanks!
If I very bad at maths I just suck in it,I barely passed in my math classes,if I will see a long and complex question I would just leave it. is math not for me because I feel anxiety when I see complex problems I would just close the book majority of the time.
I am trying to read an .csv file with C and compare each line with an string ("# begin of data"). The line does exist in the csv-file but my programm just wont recognize it. I tried adding \n or \0 ind the strcmp-function but it wont return a 0.
fgets(line, MAX_LINE, file);
printf("Read line: %s \n", line);
int cmp = strcmp(line, "# begin of data\n");
printf("CMP: %d \n", cmp);
if (cmp == 0){
printf("found:\n");
sleep(2);
//code
return 1;
}
im going insane
Visual studio doesnt compile even basic hello world programs im going insane
Hello,
I’m a beginner in C++ and am currently working on an exercise where I’m trying to replace the example of Kruskal’s algorithm from the textbook with Prim’s algorithm.
Would anyone be kind enough to help me review the code below and let me know if it’s correct?
Thank you!
// input.txt
7
0 1 17
1 4 83
4 6 37
6 5 27
5 2 8
2 0 1
0 5 3
1 6 21
0 3 9
1 3 30
5 3 15
6 3 40
// test.cpp
#include <iostream>
#include <vector>
#include <limits>
#include <iomanip>
#include <fstream>
using namespace std;
const int V = 80;
const int E = 80;
const int MAX = 10000;
const int INIT = -1;
const int CYCLE = 1;
const int GIVEUP = 0;
const int FOUND = 1;
const int NOT_FOUND = 0;
const int SELECTED = 1;
struct Edge {
int vx, vy, cost, order, selected;
};
vector<Edge> edges(E);
int e, s, t, tot_cost;
vector<int> Tset(V);
int vertices;
vector<vector<int>> adj_matrix(V, vector<int>(V, MAX));
vector<vector<int>> span_tree(V, vector<int>(V, MAX));
void inputGraph();
void inputEdge(int i, int j, int cost);
void spanningTree_Kruskal();
void spanningTree_Prim();
int isCycle(int ee);
void outputGraph();
void outputSpanTree();
void inputGraph() {
ifstream inputFile("input.txt");
if (!inputFile) {
cerr << "Unable to open file input.txt" << endl;
exit(1);
}
int i, j, cost;
e = -1;
s = -1;
t = -1;
tot_cost = 0;
inputFile >> vertices; // Read the number of vertices
cout << "\nPlease enter the number of vertices in the undirected graph: " << vertices << endl;
cout << "Please enter the edges of the undirected graph (0 <= edge number <= " << vertices - 1 << ")...\n";
if (vertices > 0) {
adj_matrix.assign(vertices, vector<int>(vertices, MAX));
span_tree.assign(vertices, vector<int>(vertices, MAX));
while (inputFile >> i >> j >> cost) { // Read edge data
cout << "Edge connects vertices (-1: end): " << i << endl;
cout << " and vertex: " << j << endl;
cout << " cost (or distance): " << cost << endl;
adj_matrix[i][j] = cost;
adj_matrix[j][i] = cost;
inputEdge(i, j, cost);
}
}
inputFile.close();
}
void inputEdge(int i, int j, int cost) {
e++;
edges[e] = { i, j, cost, 0, INIT };
}
void spanningTree_Kruskal() {
int order = 0, select_edge = 0;
cout << "\nBuilding the minimum spanning tree using Kruskal's algorithm...\n\n";
while (select_edge < vertices - 1) {
int ee = -1, min = MAX;
for (int j = 0; j <= e; j++) {
if (edges[j].selected == INIT && edges[j].cost < min) {
min = edges[j].cost;
ee = j;
}
}
order++;
int cycle = isCycle(ee);
if (!cycle) {
select_edge++;
edges[ee].order = order;
edges[ee].selected = SELECTED;
tot_cost += edges[ee].cost;
cout << "Step " << order << " ==> Select edge (v" << edges[ee].vx << ", v" << edges[ee].vy << ") ";
cout << "distance=" << edges[ee].cost << " total distance=" << tot_cost << endl;
span_tree[edges[ee].vx][edges[ee].vy] = edges[ee].cost;
span_tree[edges[ee].vy][edges[ee].vx] = edges[ee].cost;
}
else {
edges[ee].order = order;
edges[ee].selected = GIVEUP;
cout << "Step " << order << " ==> Give up edge (v" << edges[ee].vx << ", v" << edges[ee].vy << ") ";
cout << "distance=" << edges[ee].cost << " total distance=" << tot_cost << endl;
}
}
}
void spanningTree_Prim() {
vector<bool> inMST(vertices, false); // Mark whether a vertex is in the MST
vector<int> key(vertices, MAX); // Store the current vertex's minimum edge weight
vector<int> parent(vertices, -1); // Store the starting vertex of the minimum edge
int start = 0; // Start from vertex 0
key[start] = 0; // Set the key value of the start vertex to 0
tot_cost = 0;
cout << "\nBuilding the minimum spanning tree using Prim's algorithm...\n\n";
int step = 1;
for (int count = 0; count < vertices; ++count) {
// Find the vertex not yet in the MST with the smallest key value
int u = -1, minKey = MAX;
for (int v = 0; v < vertices; ++v) {
if (!inMST[v] && key[v] < minKey) {
minKey = key[v];
u = v;
}
}
// If a valid vertex is found, add it to the MST
if (u != -1) {
inMST[u] = true;
// Record the selected edge and accumulated cost
if (parent[u] != -1) {
tot_cost += adj_matrix[u][parent[u]];
span_tree[u][parent[u]] = adj_matrix[u][parent[u]];
span_tree[parent[u]][u] = adj_matrix[u][parent[u]];
cout << "Step " << step++ << " ==> Select edge (v" << parent[u] << ", v" << u << ") ";
cout << "distance=" << adj_matrix[u][parent[u]] << " total distance=" << tot_cost << endl;
}
// Update the key values of all adjacent vertices not yet in the MST
for (int v = 0; v < vertices; ++v) {
if (adj_matrix[u][v] != MAX && !inMST[v]) {
// Update the key if a smaller edge is found
if (adj_matrix[u][v] < key[v]) {
key[v] = adj_matrix[u][v];
parent[v] = u;
}
// If a discarded edge is found, show it's discarded
else if (adj_matrix[u][v] > key[v] && parent[v] != u) {
cout << "Step " << step++ << " ==> Give up edge (v" << u << ", v" << v << ") ";
cout << "distance=" << adj_matrix[u][v] << " total distance=" << tot_cost << endl;
}
}
}
}
}
}
int isCycle(int ee) {
bool vx_found = false, vy_found = false;
for (int i = 0; i <= t; i++) {
if (edges[ee].vx == Tset[i]) vx_found = true;
if (edges[ee].vy == Tset[i]) vy_found = true;
}
if (vx_found && vy_found) {
return CYCLE;
}
else {
if (!vx_found) Tset[++t] = edges[ee].vx;
if (!vy_found) Tset[++t] = edges[ee].vy;
return !CYCLE;
}
}
void outputGraph() {
cout << "\nThe adjacency matrix representation of the undirected graph is: \n\n ";
for (int i = 0; i < vertices; i++) cout << setw(6) << "v" << i;
cout << endl;
for (int i = 0; i < vertices; i++) {
cout << "v" << i << " ";
for (int j = 0; j < vertices; j++) {
if (adj_matrix[i][j] != MAX)
cout << setw(7) << adj_matrix[i][j];
else
cout << setw(7) << "x";
}
cout << endl;
}
}
void outputSpanTree() {
cout << "\nThe minimum spanning tree of the undirected graph is: \n\n ";
for (int i = 0; i < vertices; i++) cout << setw(6) << "v" << i;
cout << endl;
for (int i = 0; i < vertices; i++) {
cout << "v" << i << " ";
for (int j = 0; j < vertices; j++) {
if (span_tree[i][j] != MAX)
cout << setw(7) << span_tree[i][j];
else
cout << setw(7) << "x";
}
cout << endl;
}
}
int main() {
inputGraph();
outputGraph();
//spanningTree_Kruskal();
spanningTree_Prim();
outputSpanTree();
return 0;
}
I am a 3rd year student and placements will start in about 6 months (top state govt. College). I wasn't able to explore or brush up my skills till now due to health issues.
I know c++ and python enough to do codeforces div 2 first problem(and sometimes 2nd too) What should i do rn ?
I have learned that DSA is very important and i should do some good project but Web dev is too crowdy rn, i have more interest in ml (i haven't done anything in it yet). I am considering taking some courses for fast paced distraction free learning(and it will might save my exploration time too but i can't afford much)..
What is the most efficient way of doing these things ? Is this a good approach? What can i do better ??
I also looped each character as int in result, but everything seemed right.
I also tried to put a newline after result, but it still did not work.
Any help is appreciated.
Compiler Message Wrong Answer
Input (stdin)
10101
00101
Your Output (stdout)
10000
Expected Output
10000
int main() { char number_one[64], number_two[64];
fgets(number_one, 64, stdin);
fgets(number_two, 64, stdin);
char result[64];
for(size_t i = 0; ; i++) {
if(number_one[i] == '\0') {
result[i] = '\0';
break;
} else {
if((number_one[i] == '0' && number_two[i] == '0') || (number_one[i] == '1' && number_two[i] == '1')) {
result[i] = '0';
} else if((number_one[i] == '0' && number_two[i] == '1') || (number_one[i] == '1' && number_two[i] == '0')) {
result[i] = '1';
}
}
}
printf("%s", result);
return 0;
}
How do I account that from worst to best case, they all have the same time complexity?
Like dfs and bfs aside from using dp. Any other common techniques?
void clearConsole() { try { final String os = System.getProperty("os.name"); if (os.contains("Windows")) { new ProcessBuilder("cmd", "/c", "cls").inheritIO().start().waitFor(); } else { Runtime.getRuntime().exec("clear"); } } catch (final Exception e) { e.printStackTrace(); } }
Hello. I've been stuck on this Lab program for my CS course for the past 2 days and I am so deep in the forest I can't see the trees around me anymore.
I was wondering if anyone could take a look and help me determine the issue in my logic for why I am returning the wrong node when I "check an invalid tree with a right child linking to it's ancestor node."
Missing code breakdown:
- The "Node.java" file provides the Node class with access to the node value using getData, and the left and right node values through getLeft and getRight methods.
- The "Main.java" file breaks apart the input through a "tuple-based" representation of a binary search tree.
The input looks like this:
(50, (25, None, (60)), (75))
Here, the program would return 60, because that node violates a BST because the node 60 would be on the left side of the tree, and 60 is greater than the root node 50.
50
/ \
25 75
\
60
import java.util.*;
public class BSTChecker {
public static Node checkBSTValidity(Node rootNode) {
// helper method with null boundaries and an empty set for ancestors
return checkBSTHelper(rootNode, null, null, new HashSet<>());
}
private static Node checkBSTHelper(Node node, Integer nodeMin, Integer nodeMax, Set<Node> ancestors) {
// base case: if the node is null, the subtree is valid
if (node == null) {
return null;
}
// if node is not null and less than min, then violation and return node
// or
// if node is not null and greater than max, then violation and return node
if ((nodeMin != null && node.key <= nodeMin) || (nodeMax != null && node.key >= nodeMax)) {
return node;
}
// check ancestor set for violation
if (ancestors.contains(node)) {
return node;
}
// return the current node causing the left child violation
if (node.left != null && ancestors.contains(node.left)) {
return node;
}
// return the current node causing the right child violation
if (node.right != null && ancestors.contains(node.right)) {
return node;
}
// add current node in traversal to ancestor hash set
ancestors.add(node);
// recusively check left side
Node leftViolation = checkBSTHelper(node.left, nodeMin, node.key, ancestors);
if (leftViolation != null) {
return leftViolation;
}
// recursively check right side
Node rightViolation = checkBSTHelper(node.right, node.key, nodeMax, ancestors);
if (rightViolation != null) {
return rightViolation;
}
// remove node once traversed
ancestors.remove(node);
// return null if no violation detected in subtree
return null;
}
}
The criteria for this program:
```Java
A violating node X will meet one or more of the following conditions:
```
All of my unit tests pass except # 9, where "X's left or right child references an ancestor" is not returning the correct node.
Here are my unit tests:
1: Input
(10, (20), (30, (29), (31)))
Your output
20
2: Input
(20, (10), (30, (29), (31)))
Your output
No violation
3: Input
(80, (60, (40, (20, None, (50)), None), None), None)
Your output
50
4: Valid tree with 10 nodes
Test feedback
BSTChecker.checkBSTValidity() correctly returned null
5: Invalid tree with right child's key less than parent's key
Test feedback
checkBSTValidity() correctly returned the rule-violating node.
6: Invalid tree with left child's key greater than parent's key
Test feedback
checkBSTValidity() correctly returned the rule-violating node.
7: Invalid tree with lesser key in right subtree
Test feedback
checkBSTValidity() correctly returned the rule-violating node.
8: Invalid tree with right child linking to ancestor
Test feedback
checkBSTValidity() returned a node that is not the BST rule-violating node. The node with either the left or right child pointing to an ancestor must be returned.
9: Invalid tree with left child linking to parent
Test feedback
checkBSTValidity() correctly returned the rule-violating node.
10: Invalid tree with left child linking to ancestor
Test feedback
checkBSTValidity() correctly returned the rule-violating node.
I currently install/program point of sale software but would like to get a full time programming gig.
What language should I try to learn? I use SQL every so often for simple query's and updates.
Are their programming jobs for SQL and are they worth pursuing?
soooo i am a very very noob guy and i joined a college (fresher, but late because failed a lot) which is not at all related to computer science but I still want to continue programming and cs as it is my passion (not just saying out of blue cuz i liked tony stark) . I was very good at maths but somehow lost the track for past 4 years (failed a lot lol) , currently i want to regain my mathematical powers too. Also I forgot to mention I am in an engineering college so it's not like I am totally disconnected with maths academically . Nowwwww what I need ! , There are tons of Youtube tutorials on how one should proceed and roadmaps (afterall i have to learn from youtube right?) , the reason I am here (again , changed) is to ask what should be the best
1)source
2)roadmap
3)suggestion of language and projects
I umm do not believe there is something best which i would follow and get all einsteined!! but what i need is from y'all experts that a noob like me who can use is hibernating brain and wake it up again and get going into what he really wants. Some other questions which i want to be answered is after this AI effect and all this machine learning being a necessity what should i target from a financial point of view and some good job prospective. I stated above that cs is my passion but to say it in a more broader way about my passion I like Quants , business and shit and programming and AI are like a addon to them which i also like . It's like years before when i was in the game i had targeted i would do sql , data science , quants and all but now after being brain rotted all these years I have no ffin clue so I am here. :)
PS: Was a fulltime reddit rot (thankfully deleted that) , one of the reasons for downfall , should've controlled . sheeshhhhh not going down the memory lane past is past , i don't wanna look back and even if i do wanna look back it would be a moment where i think of it as a good time spent posting skibidi memes lol (still got the humor i guess , will continue but not the same way as it was)
Now I am yapping a lot sorry (There is no purpose of this post to get excessive upvotes or smtg , i just want your genuine help for a believer like me) , i think i have yapped much and framed my questions well . Will check all yours suggestions after my sem exams are over (prolly 3 weeks at most) , old me wouldn't had did this but i don't wanna repeat the same mistake of wasting time at time of exams lol which if i utilized i would've been a mod here rather than being a mod for some brain rot meme page ( no hate , laughing is life) . Sayonara
I see Stainless API, Scalar API, Speakeasy, etc.
I want to know the standards developers take in 2024
I know I can build a Python SDK without those tools but I just wanna see what's out there and which is used for which...
If you could help me out, I would really appreciate it.
I'm wondering if anyone has any experience transitioning from logic design (writing in Verilog and Systemverilog) to software engineering. From a distance Systemverilog looks like any other programming language but of course it's quite different conceptually.
I wonder how easy, or difficult the switch would be.
Hi everyone,
I have a basic understanding of programming, but I’m looking to improve my logic-building skills while learning .NET MVC and SQL. I’d love to team up with others who are also eager to learn or practice together!
We can work either one-on-one or form a small group (3-5 people) for a more collaborative and engaging experience.
Here’s what I’m aiming for:
I’m flexible with timings and open to different formats, whether it’s calls, chats, or shared coding platforms like GitHub.
If you’re interested, Please let me know. Let’s learn and grow together! 😊
Both type of algorithms are dividing problem on smaller problems until problem is small enough to be easily solved.
It seems that Divide and Conquer is combining solutions of small problems to get final solution.
Can we assume that Divide and Conquer algorithms are basically Top Down and Bottom Up algorithms combined?
I am pretty new to all of this and starting from scratch. But quite lost when it comes to the “building my portfolio” realm.
I am starting off with saving my homework and projects from classes I am taking for free right now. (cannot afford to pay for classes but edx.org is great for this atm.) currently just taking the mere basics: intro to CS, have done basic python, and scratch so far. Then will take intro to prog with python. I’ve done a project for HTML5 already so I’ll be adding that too.
should I save the homework and projects I am doing with the classes I’m taking rn?
how am I able to build a website for free? I see a lot of portfolios have their own domain… how can I do this?
is a “portfolio” basically a domain where you attach all your work in there? If so, how can I make it where all my work is cohesive in there to show candidates once I do finish some classes?
have any of you started from scratch, no degree in CS, but learned the skillset, got your portfolio right, and got entry level positions?
would internships be applicable to me even if I am not enrolled in an institution but rather taking free classes that teaches you how to code?
Currently using edx.org
Professor David Malan from Harvard University is teaching these classes. Pre recorded ofc. just in case anyone needs then information. Completely free and pretty much feels like you’ve paid for the course itself.
I am pretty lost in this and prob not asking the right questions but I hope I can find some clarity on here. Thank you.
I’m so behind on python I don’t understand and idk how to code yet by myself. I have a big exam one week left can I cram all this material?
The text has been extracted successfully. Here’s the content of the study guide from the images:
COMP 171: Final Exam Study Guide
This study guide notes the topics that will be covered by the exam, and offers some breakdown of the topics into important sub-topics to keep in mind.
For all topics listed, you should be able to write code, understand/trace code, and answer open-ended questions relying on these topics (as you’ve seen on the quizzes).
Design
• Important components of software design:
• Input, Output, Examples
• Domain Knowledge, Algorithm
• Know how to write a complete design from a client request.
• Design as related to functions (see Testing/Designing Functions).
Creating and Using Variables
Primitive Data Types
• int, float, str, bool
• How to convert between data types.
Expressions
• Math operators: +, -, *, /, //, %
• Boolean Expressions:
• Getting True or False with ==, !=, >, <, >=, <=.
• Combining Booleans with and, or, not.
• Order of operations.
Control Structures
• if, elif, else statements, while loops.
• How these structures make use of Boolean Expressions.
• for loop:
• range function (1, 2, or 3 arguments).
• for loops vs. while loops:
• Why choose one over the other.
• How to convert between them.
• Nested control structures (e.g., if inside while, nested for loops, etc.).
Functions
• Calling functions, passing arguments, saving return values.
• Built-in functions: print, input, range.
• Defining your own functions:
• docstrings, parameters, returning values, side effects (see also: collections).
• Tracing functions:
• Tracing variables, arguments, parameters, return values, and side effects in programs with function calls.
Testing/Designing Functions
• Test Driven Development (TDD): Writing tests before writing the code for the function.
• Tests and function stubs as designs:
• docstrings show input/output from functions.
• Tests show examples.
• Choosing good test cases, writing several different tests to check different behavior.
Strings as Collections
• Simple actions to use strings as collections:
• Creating, indexing, looping, concatenating.
• Using these simple actions to make more complex functions:
• find, count, slice, remove, etc.
Lists
• Common actions on lists:
• Creating, indexing, looping, appending.
• Searching for an item in a list (find function).
• Indexing to access/change items in lists.
• Using a for loop to:
• Access/change items in a list.
• Passing lists as parameters, and returning lists.
• Tracing how lists are stored differently in memory, and the results.
• Side effects:
• How/why passing lists is different than other data types.
• When/how side effects are possible with lists.
Here is the extracted content from the latest image:
2D Collections
• 2D lists: Lists of lists, lists of strings.
• Accessing, creating, changing individual items in 2D lists.
Dictionaries
• Putting key-value pairs into dictionaries.
• Checking if a key is in a dictionary.
• Accessing values with a key from dictionaries.
• Iterating through all keys and values in a dictionary.
• Side effects on dictionaries.
Lists vs. Dictionaries
• When to use a dictionary over a list?
• When to use a list over a dictionary?
Reading Information from Files
• Opening and closing files.
• Getting data from text files using readlines().
• Cleaning up data:
• Changing strings into lists (split function).
• Removing \n.
• Turning strings into integers or floats.
Let me know if you’d like further clarification or additional formatting! 
I did do some in 6th grade robotics and I loved it but I don’t go towards that direction up until now. It’s my first year in college and I’m doing comp science. I have cis 150 next semester but I wanted to learn some coding in my own time as well. Should I buy a programmable rc car? If so which one would you guys recommend? Appreciate the response
I use pop os and i am learning machine learning but suddenly i am thinking about distro hopping to linux mint or something arch based but are these two viable option?
I know basic programming but not enough knowledge to create an app or a website.
But I have the desire to make my own one.
Help me with any ideas excluding all the oversaturated projects like hospital management, school management, etc...
What should I focus on?
How to plan it?
Where to start it?
Within 4 months😅?
Maybe it sounds lunatic, but I wanna create something not just for college but also that helps me to add value to my resume.
Hi everyone. I’m currently stuck between two majors/minors. My options are:
Mathematics and statistics (major) - computer science (minor)
Computer science (major) - statistics (minor)
I love math, specifically stats, but all math is interesting to me. I equally love computer science. Some of my other interests are ML, AI, modeling, neural networks, and data analysis. Which of these paths would get me on the right track for a secure, well paying job? I’m not super knowledgeable in the before mentioned fields so I’m struggling to decide what would be the right path for me. Any insight would be greatly appreciated!!
So i am preparing for a hackathon being held Feb next year.
I was looking for a good project for it, then i came across a project,
"Decentralized Crowdfunding Platform: A blockchain-based platform to support small businesses or social causes."
It has a pretty standard tech stack, but it also contains blockchain (obviously).
So i wanted to know if learning blockchain is even worth it nowdays.
Check it out here: https://x.com/roshi_xyz/status/1864257060042330455
Hey everyone! 👋
I created a tool that lets you step through Python code for LeetCode problems, line-by-line. It highlights the current line being executed and shows real-time values of variables and sub-expressions. Super helpful for debugging or understanding how code flows!
It’s still a work in progress, so there are a few bugs 🐛, but I’m actively working on it. Would love any feedback or suggestions!
Okay, so while I've been familiar with coding for years, I'm still pretty much a noob tbh. I'm trying out the Advent of Code event and i managed to solve Day 1's problems, I am currently stuck on Day 2's. I was wondering if maybe there's a way I'm supposed to approach these problems to get to the solutions.
I wanted to know if there's a way I'm supposed to approach solving these problems or a way I'm supposed to be thinking? I've been meaning to hop onto leetcode after the event, but I'm worried I won't be able to handle them.
What are some advices you can share when it comes to becoming a problem solver? Should I write on pen and paper first? should I look at tutorials? Is it advised to use these LLMs for advice without them giving me the answer?
How can I improve?
I've been using Python as my language of choice.
I had recently joined the Udemy course entitled "The Complete 2024 Web Development Bootcamp" by Dr. Angela Yu. When I started with the HTML part, I breezed through the exercises and concepts with little difficulties apart from certain roadblocks.
However, as I started the CSS module, especially the Advanced CSS parts, I found it very difficult to understand the concepts and have been struggling with the exercises. I have rewatched the videos and referred to multiple websites, but I just can't seem to grasp the concepts thoroughly.
Due to this, I have pathologically procrastinated for months, without actually trying. But I want to learn web development. I am interested in the work, but it just seems to be very, very difficult. To be particular, the concepts such as CSS Float, CSS display, the combining of CSS Selectors just seems to go right through my head.
I have seen people say that learning CSS is extremely easy and after hearing that, I feel extremely stupid. Can you give me some advise on how to proceed further? Please advise.
(I'd like people who think of themselves as experienced/intermediate programmers to comment on this post only)
So I'm somewhere b/w a beginner and an intermediate programmer and I'd like to know how I can best use AI to assist me in programming. I don't want to rely completely on it and I don't know how much I should rely on it. I was using vscode this morning and installed the blackbox ai extension because I was having trouble solving a set of problems. A few minutes later I found myself going back to the extension every time I got stuck at a problem. There have been amazing programmers before me and they didn't have AI. How did they get through these hurdles while solving problems? I mean obviously their process was more extensive, book reading, highlighting notes etc. but now, everything is a prompt away.
Could I get some advice on whether I should have extensions like GitHub Copilit, BlackBox etc. installed in my code editor? If yes, how do I use it to actually "learn" programming and not copy everything?