Relative Content

Tag Archive for if-statement

What is an if statement?

69-year developer using C, C++, Java, Python, JavaScript, C#, Ruby, Swift, Go, Kotlin, PHP, Rust, TypeScript, Perl, R, Scala, Objective-C, Dart, Elixir, Haskell, HTML, CSS, SQL, XML, Lisp, Scheme, Clojure, Erlang, F#, Bash, PowerShell, Lua, Tcl, AWK, Assembly, Fortran, Ada, INTERCAL, Malbolge, Befunge, Piet, Whitespace, LOLCODE, Ook!, MATLAB, RPG, SAS, VHDL, Verilog, PostScript, COBOL, Pascal, Smalltalk, Prolog, ALGOL, Simula, Groovy, Crystal, Nim, Julia, Solidity, Vala, Racket Vim and Brainfuck.

Vs code bug causing code to not enable correctly

Trying to edit some firmware for a 3d printer to enable different functions to make my 3d printer work with it’s new motherboard. The problem I’m having, is when I uncomment a #define, it doesn’t enable all the functions underneath that #define. So not all of the code gets highlighted and enabled within the #if to #endif section.

If/Elif Statement Only Responding to Initial Check

I’m still very new to python and I’m coding a simple program to decrypt a poem. The first thing that needs to be done is that the user puts in the poem, which is broken down into a list, where then the base pairs are put into binary. To sort them into binary I’ve tried using an If/Elif statement (posted below) but the code routinely only responds to the first half. It will only print the 1’s or 0’s depending on which I leave first in the code.