Questions tagged [beginner]

Add this tag to your question to indicate that you are new to the language of your code. This will often be taken into consideration by reviewers when assessing your code.

Filter by
Sorted by
Tagged with
6
votes
3answers
155 views

Hangman Game (YAHG)

I’m in the process of learning C++ and this was an assignment for a class. It is a simple hangman game. The instructor gives no feedback, only a pass/fail remark. While this works, I would like to ...
9
votes
5answers
654 views

Comma Code - Automate the Boring Stuff with Python

Below is my code for the Comma Code problem from Chapter 4 of Automate the Boring Stuff with Python. Is there anything I can do to make it cleaner? Comma Code Say you have a list value like ...
1
vote
1answer
51 views

Bank account class

Simple object-oriented, money management code where a user can deposit money in, withdraw from, show, and exit the balance. ...
1
vote
0answers
24 views

FAMILY.PY | OOPython

Simple code where family and person instances can be created. There is a method where any instance of Person can be added to any instance of Family. ...
5
votes
2answers
111 views

Wrapper for Python's argparse class

I'm just trying to learn python: I tend to write my own customized wrappers arround "more complicated" python functionalities so that i can use them more easily, more consistent, easier to change in ...
9
votes
2answers
330 views

Converting integers into Unary Notation

I have written a python script that has tallies representing digits 1-9 (0 is just ":" ) Unlike true Unary languages that are in the form 1^k. I represent values for n as per their decimal digits. The ...
3
votes
0answers
45 views

Getting a list of waypoints assuming that there is a map [on hold]

I'm a beginner learning ROS. I'm developing an android application that will control my robot and that includes getting the list of waypoints to display it to my spinner. How do you get the list of ...
2
votes
2answers
73 views

Digitizing paper label system with Python

I'm currently halfway through a Python project, but would like a review before I spend too much more time on this to avoid going too far down a rabbit hole. I had previously wanted to use HTML, CSS, ...
6
votes
2answers
130 views

rock paper scissor

I just started to learn C++ and I decided to make a rock paper scissor game. It works very well but I would like to know how could I improve it further. Thank you very much in advance for your help. <...
1
vote
1answer
90 views

Basic Pong game using C++ and SFML

I am making use of C++ and SFML to make a basic Pong game. I have made it so that there are two players who can control the paddle on each side and the ball will bounce off screen and paddles except ...
13
votes
2answers
476 views

Get the encrypted payload from an unencrypted wrapper PDF document

This is code, written by our dev team, and SonarQube tells me that the Cognitive Complexity is too high: 21, and the current (default, out of the box) metric limit is 15. I've had a go at reducing the ...
2
votes
1answer
32 views

Plotting a parabola using Tkinter

I'm a beginner, and I have just written this basic code that simply plots a parabola in a graph. Is it possible to make my code more efficient? The process works by the creating lists of X and Y then ...
12
votes
4answers
922 views

Account creation and log-in system

I've been learning Python for about 1 - 1 1/2 weeks now and just finished my first small project to help solidify what I've learnt. It's a very basic (bad) login / create account system that I run in ...
-3
votes
0answers
23 views

Calling function in class in hotel reservation system (python) [closed]

I dont know how to use and call the def function under class. I am not sure how to use the input data for the class. There are two text files which will be used, about the rooms: room id and price of ...
4
votes
1answer
84 views

Tokenizer Class for handling .csv files in c++17

I am a hobbyist computer programmer trying to learn modern C++ (in this case C++17). I thought it might be an interesting challenge to write a tokenizer class for ...
1
vote
0answers
39 views

MATLAB / vs Python np.linalg.solve, heat diffusion, Why Python is slow? [on hold]

I am solving a simple 1D steady heat question using spectral method. I am a long time MATLAB and Mathematica user and trying to learn Python. I compare only linear solving times and Python is way ...
-1
votes
0answers
65 views

Night out with friends. Calculating the costs per person with Kotlin and Android

The following app basically sums up the costs for an evening and calculates the costs per person. The user can input the description of the costs [String] (for example, round one = Spare Ribs Place, ...
0
votes
0answers
27 views

Function to determine state of Christmas tree lights? [closed]

My friend and I are trying to automate some Christmas tree lights that I got on sale last year. I will be able to measure the output of the voltage, and there are 4 functions: steady on, blinky on, ...
3
votes
0answers
56 views

Convert text file to html?

I have a script that converts a text file to html. The text file is an output of a program (needle). The function takes the text file as an input. I am aware the script is awful. I use this function ...
2
votes
1answer
51 views

Query a product from a list of brands

I am quite new to F# and just wrote my first program. It checks if the query exists in the brand list and returns the matching brand. Query is the string you are searching for in the brand list. So ...
7
votes
1answer
52 views

Find neighboring PINs on a numeric keypad

I am new to coding and to apply for an internship I need to solve several tasks. This is one of them. I wrote working code, but the program says it takes too long to complete. Help me speed up my code ...
4
votes
1answer
92 views

Converting a binary string to hexadecimal using Rust

Once again, I am reinventing the wheel here to understand the fundamentals of rust. In a previous question I requested feedback on my function that performed a hexadecimal to binary conversion. In ...
0
votes
2answers
79 views

Python code to continue if a certain type is seen, otherwise try again to get valid input [closed]

I am very very new to programming, and this is my first day using Python. I want to check to see if an input is of type 'int' and to proceed with my program if the user has entered an 'int', ...
1
vote
0answers
16 views

List files and folders in current dir with special handling for tty

I want to write a custom ls command to learn rust. This is what I've done as for the version 1.0. This display files and folders in a cyan or white if it's on a ...
8
votes
3answers
645 views

Read string of any length in C

I've written code in C for reading a string of any length, and printing the string. It's one of my first C programs. I posted the program as part of a Stack Overflow question, and received a comment: ...
5
votes
2answers
160 views

Calculator app in React

This is a simple calculator app that involves entering two numbers and allowing them to be editable and swappable. Calculations are done on the numbers, so the calculations should only be done when ...
4
votes
1answer
40 views

Evaluate mathematical expression in reverse Polish notation in C

This is a program exercise from The C Programming Language by Kernighan and Ritchie (Chap 5). It is based on my earlier question here on Stack Overflow. One user suggested to submit my code here, ...
2
votes
1answer
64 views

A small protein database

I am making a small database and these are the following files. The scripts are working. How can I improve my scripts? Are there any places where a problem could occur? I have yet to write tests for ...
9
votes
2answers
97 views

Simple Python3 Checkers

I'm a beginning "pythonist" my current task is to write a checkers game and I need some suggestions here and there: are the code style and literacy answering the criteria of python? are the modules ...
2
votes
0answers
19 views

Structure and Code of Tornado WebAPP

I wrote a test application to familiarize myself with the Tornado Python framework. The application currently generates a cookie that you can view and delete. I ...
4
votes
1answer
46 views

Converting a hexadecimal string to a binary string using Rust pattern matching lookup

I am getting started in Rust, and as a part of my first exercise, I decided to write a small program that converts a hexadecimal string to a binary string using a pattern matched lookup. I would ...
0
votes
1answer
52 views

Personal quiz with input validation

The object of the code is to prompt the user with a quiz and collect the g's, y's, 0's, and 1's and if there is more than one then the user passes (else, they fail). I am a beginner and would like to ...
6
votes
1answer
686 views

Rust Torrent Parser

I wrote a simple Torrent file parser. The following program accepts a file and builds a Torrent structure based on the contents on the file. If the file is invalid, the app crashes (as intended). It'...
-1
votes
1answer
31 views

Python ANN Implementation [closed]

I recently learned about backpropagation online and tried to implement it. I am not sure I have it correct yet. I am confused and would love a second pair of eyes on this code. Please help me ...
6
votes
2answers
95 views

Printing the max of groups of three random ints

I'm trying to teach myself streaming and lambda expressions. Here's the scenario: I have a collection of 10 Thing objects each containing an int[] of 3 random number. I've written code to print out ...
3
votes
3answers
104 views

(Project Euler #1) Find the sum of all the multiples of 3 or 5 below 1000

I have decent experience in programming before (mostly C++), but I am very, very, very new to Python, and I decided to try out Project Euler as an exercise. Here's the description of Problem 1: If ...
3
votes
1answer
64 views

Caesar Cypher guessing game

Caeser's cipher code where there are a converter and a game part with user input. The code includes keys (settable and not settable). ...
2
votes
2answers
36 views

Scala app to transpose columns into rows

This is the first application or really any Scala I have every written. So far it functions as I would hope it would. I just found this community and would love some peer review of possible ...
16
votes
2answers
2k views

Translate English to Pig Latin

This is a program for converting English to the pseudo-language Pig Latin. Not the strictest form of Pig Latin but it most likely will accurately output an argument in Pig Latin. I got the idea from a ...
28
votes
8answers
4k views

Project Euler Problem 45

As a self-teaching Python beginner for almost 4 months, I have mostly been doing online challenges including Project Euler problems. Problem 45 asks: Triangle, pentagonal, and hexagonal numbers ...
7
votes
2answers
104 views

K&R2 solution to exercise 1-18 (discarding trailing whitespace and empty lines)

Recently I have started learning C++ and I decided to learn C along the way to improve my understanding of how computers work. For C I am using "The C Programming Language Book" by Brian Kernighan and ...
3
votes
1answer
77 views

Toy Expression Interpreter

I've just started learning Rust (coming from Haskell) and decided to test a toy expression interpreter. Code: ...
8
votes
0answers
134 views

spawn() for gawk

Awk has a builtin function named system which makes it possible to run shell commands from awk scripts, but it is completely unsafe to build commands using user-...
4
votes
1answer
33 views

PyTorch Unit-testing in Python

I'm new to PyTorch and I'm writing a unit test for an activation function I'm making. I plan to test against a reference implementation for this function. I want to approach this in a test-driven way,...
3
votes
2answers
50 views

Breakout clone in pygame

As a guy who started coding a month ago i would like an honest review of my version of breakout that i created using pygame. ...
2
votes
3answers
62 views

Getting the Sum of Discounted Price

Jojo is browsing the internet while suddenly he sees an ad about the new cafe. The promotion is if the price of an item is N dollars, then you can buy the second item for half the price, the third ...
8
votes
1answer
124 views

Convert to dictionary

Earlier I did post with full code about Prepare and export data to MS Word file. The user t3chb0t recommended me to separate some part of full code to this post. Context The task of code for review ...
2
votes
2answers
34 views

This code searches for an object which meets mathematical Max, Min, or less than/greater than criteria at certain counter i points

I am new to JavaScript. The below code works on array y from tree values of 1 to 5, but I want to extend it to check trees value of 100. array y is of the type [{key:value, key:value}, {key:value, ...
3
votes
1answer
32 views

Shell script to set up Ant targets and properties for a new project

I've written this shell script to place Ant build.xml and build.properties into my project directory. It takes two options, one which ensures the project is set up for JUnit test compilation/running. ...