I’m working on a program that is a simulation of an order form/receipt. First, the program prints an invoice, then later prints a receipt based on which payment schedule the user selects (1-4 years) My problem is that I can’t find a way to get the invoice and receipt to print the same monthly paym…
Tag: range
Python Loops result not understanding [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 6 months ago. Improve this question Can …
Solved: A simple calculator to accept two numbers and print the addition, subtraction, multiplication, and division of the two numbers
Update: Re did my code. Now **I am unable to find the answer to this issue no 1). ** Newbie here. I spent the whole night trying to figure this out but I feel stuck if anyone can kindly guide me. Below is the question and Code I did for python. Thanks in advance. Limit the input range from -70
String Slicing in c# using intervals
In python there are ways that allow you to access the string using an interval(slicing): Example Get the characters from position 2 to position 5 (not included): Is there something similar in c#? Answer In C# 8.0 (or higher) you can use ranges, e.g Or on old c# versions, Substring: Finally, you can use Linq, …
I don’t get a print result of function when using range
Why can’t I see the result of the function when I use range()? I want to create a range of numbers where each the number will be evaluate in “colla” function. But range doesn’t work with “colla” Answer Your colla() function requires input numbers of 2 and above. Try this: P…
Using a for-loop and range function vs a while-loop
I’m looking for a function like range except that the step is a fraction of the previous number generated. So if the fraction was 99/100 the set of numbers might be something like this: 100, 99, 98.01… 0.001 Would this be more efficiently done with a for-loop and range-like function or with just a…
Python: generate 5 random int (every has own range) with fixed sum
Each value in Total has own range (in %). First: find random values (within ranges that is % from Total.). I tried this (but sum() can be >or< than 100): Second:find exact value for a,b,c,d,e (according to the percentage from Total in First part). I tried this: This code does not work. please help Answe…
Including the last value in a range loop Python 3
I am having issues trying to get my code to print the last value of the range when I am running a loop. Here is the problem I was given with my code at the end: Here is the output I receive: A B C D E F G H I J K L M N O P Q R
How to check check if a string contains a specific character(s) using range() functions and bools in Python?
I’m trying to check in Python GUI if the user’s email is valid after every key release. So I set global bool variables, which are at and dotcom for email validity, but every time I input a valid email format. the bools are still set to false. This is my function for checking the email validity The…
Why set automatically unpacks range, but list doesn`t? How this can be used?
I create list and set with range. Set unpacks range, list doesn`t Answer The reason why it doesn’t unpack is because my_list is only putting two brackets next to it, if you do that with set it will be the same: But if you do list(…) it will unpack: