Computer Science, asked by twinygirls25, 4 months ago

Create a program in python to print the negative odd numbers between -30 to -1. ​

Answers

Answered by poojan
11

Python program to print the negative odd numbers between -30 to -1.

Note that between is an inclusive property. So, -1 doesn't come into the list and the checklist goes from -30 to -2.

Program:

#Without condition [As every alternate number is an odd number]

for i in range ( -29, -1, 2):      #-29 is the last odd number as per given data.

   print(i)

#With condition

for i in range (-30, -1):

   if i%2!=0:

       print(i)

Output for both the programs:

-29

-27

-25

-23

-21

-19

-17

-15

-13

-11

-9

-7

-5

-3

Learn more:

Raju has a square-shaped puzzle made up of small square pieces containing numbers on them. He wants to rearrange the puzzle by changing the elements of a row into a column element and column element into a row element. Help Raju to solve this puzzle.

https://brainly.in/question/16956126

Python program to find absolute difference between the odd and even numbers in the inputted number

https://brainly.in/question/11611140

Similar questions