# Tag: numbers

## Can I somehow pick a specific number from a list?

I’m new at programming and i need help with my “work”. I need to print specific number from a list. List = from 1 to 10 000 and i need to pick every single number that has “375” as a last three digits For example: 375, 1375, 2375 etc. My english isn’t the best so I hope you undestood me

## place the symbol

to add certain symbol after every three got splited lines Something like that?? – Answer This code looks if there are three or more commas in the text. If it is, it splits the text into 4 parts, then concats the 3 first parts and adds an @ before the third comma and redo the same process with the remaining

## How to deny letters and symbols in loops

I only want my code to accept numbers between 1 to 9. I tried try except, logical operators, isdigit, but I just can’t do it. Answer It look like you’re trying to print out the prompt based on the user input, and you want to make sure that it’s not higher the 9 and lower than 1. You need to

## calculate the digits of the Nth number using the given numbers [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 9 months ago. Improve this question I’d like to get the digits of the Nth number by using the given numbers which are 3 and 9.

## Python pattern right triangle with while loop in python

I need to print the numbers in a specific shape and order with a while loop, for loop is not allowed, but I don’t understand nor can I find anything on the web that can help me understand how can I move the figure a bit to the right or how I can flip it around. Here is the code

## How can I generate the smallest sequence of adjacent and distinct numbers?

For example, I would like a function that, given the symbols of + or – (ascending and descending), makes the smallest sequence of no more than 8 digits distinct and adjacent numbers examples of inputs: as i am trying: Answer Solution:

## I have a problem with if statement and numbers

my problem is I want to make the elif statement work on numbers only but the elif statement work on any datatype, is there any way i can separate the numbers in string type from the other data types The Code OutPut Answer You can use and for this: Note that you can use in to check if a key

## Python random module: How can I generate a random number which includes certain digits?

I am trying to generate a random number in Python, but I need it to include certain digits. Let’s say the range I want for it is between 100000 and 999999, so I want it to be in that range but also include digits like 1, 4, and 5. Is there a way to do this? Answer you can build

## Python: Generate random letter then Keystroke said letter

(I am using Python under Mac OS) Hey Guys, i am looking for a way to random generate a letter (a-z) and then keystroke it. The way I usually do keystrokes is: cmd = “”” osascript -e ‘tell application ‘System Events’ to keystroke “insert_letter_here”‘ “”” os.system(cmd) This won’t accept random.letter since it would keystroke the exact spelling of random.letter. Does

## Printing pair of numbers using for loop – Python

I am a beginner in python and I need some help with a case: I need to print pairs of numbers which are input from a for loop – for example Let’s say we enter 3 2 1 4 5 0 4, I need to print the sum of the paired numbers – 3 + 2, 1 + 4 etc.