numbers

New to python. I need help assigning numerical values to an email list

New to python. I need help assigning numerical values to an email list Question: I am currently taking my first python class and I need help assigning numbers to an email when it is added to my list of emails. That way when someone wants to remove an email from the list, they can see …

Total answers: 1

What is the problem with my code for finding whether a number is prime or not

What is the problem with my code for finding whether a number is prime or not Question: N = int(input()) flag = False if N <= 2: print(‘no’) for j in range(2, int(N**0.5)+1): if N%j == 0: flag = True if flag == False: print(‘yes’) else: print(‘no’) The logic is same everywhere I saw the …

Total answers: 2

Print the Number series in Pyhon

Print the Number series in Pyhon Question: Help me to solve this number series question: input : 5 Output: 2 3 4 4 5 6 5 6 7 8 6 7 8 9 10 My program : rows = 6 # number of rows in the pattern start_num = 2 # starting number for the …

Total answers: 3

How to have a space thousand separator on pyplot graphs

How to have a space thousand separator on pyplot graphs Question: I am plotting graphs but the values on my y-axis goes up to 175 000. Of course, python and pyplot does not use thousand separators by default. The graphs have to go into an article subject to formatting rules, and therefore I am using …

Total answers: 1

Find and print the square numbers in a given range python

Find and print the square numbers in a given range python Question: Find and print the square numbers in a given range python Here’s my approach a, b = int(input()), int(input()) from math import sqrt for i in range(a, b+1): if i%10 != 1 and i%10 != 4 and i%10 !=9 and i%10 !=6 and …

Total answers: 2

get maximum number stored in a list

get maximum number stored in a list Question: example #1 numbers = [‘1086’, ‘1123’, ‘543’, ‘1180’, ‘1222’, ‘1300’, ‘888’] print(max(numbers)) result: 888, desired result: 1300 example #2 numbers = [‘1086’, ‘1123’, ‘1180’, ‘1222’, ‘1300’] print(max(numbers)) result: 1300, desired result: 1300 goal numbers = [‘1086’, ‘1123’, ‘543’, ‘1180’, ‘1222’, ‘1300’, ‘888’] print(max(numbers)) result: 1300, desired result: …

Total answers: 5

Why is this code outputting multiple of the same prime numbers?

Why is this code outputting multiple of the same prime numbers? Question: Hi everyone 🙂 (I am very new at this) I am playing around with a simple piece of code which should print the prime numbers in a given range. nums = range(1, 11) for number in nums: if number > 1: for i …

Total answers: 1