1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ser-zykov [4K]
4 years ago
8

Write a Python program that accepts a numeric value from the user and prints the number starting from 0 up to the user’s value.

Computers and Technology
1 answer:
choli [55]4 years ago
3 0

Answer:

num = int(input("Enter a number:"))

#Use becuase the for loop will start at 0

num = num + 1  

for i in range(num):

 print(i)

You might be interested in
Write a loop that reads positive integers from console input, printing out those values that are even, separating them with spac
zvonat [6]

Hello, since you did not specify a programming language, I wrote this algorithm in C++. Good luck!

<h2>Code:</h2>

#include <iostream>

#include <vector>

std::vector<int> v;

int main(int argc, char* argv[]) {

   while(1) {

   int temp;

   std::cout << "\nEnter a number: ";std::cin>>temp;

   

   if(temp<0) {

       std::cout << "\nEven number(s) is/are:\n---------------------\n";

       for(int i=0;i<v.size();i++) {

           if(v.at(i)%2==0) std::cout << v[i] << " ";

           else continue;

       }

       std::cout << std::endl;

       break;

   }else {

       v.push_back(temp);

   }

}

   return 0;

}

4 0
2 years ago
They convert energy from the Sun into usable chemical energy by the process of photosynthesis. They are
Alchen [17]
Photosynthetic organisms are producers because they are producing chemical energy useable by living things.
4 0
3 years ago
For angular how can we set up th edatabse.
lesya [120]
You can not communicate directly between Angular and MySQL. You'll need to build a back-end Web service that calls MySql using php or node. Angular can communicate with this back-end Web service via http.
8 0
3 years ago
The sequencing of content in a broadcast is called a file.<br> a. true<br> b. false
Alenkasestr [34]
B
the correct name is streaming
6 0
3 years ago
Read 2 more answers
Ann has always wanted to be the person on the news broadcast who delivers the weather updates. She’s looking into becoming a bro
Marrrta [24]
The answer should be A.
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which connector is most commonly used to connect printers to desktop pc systems?
    10·1 answer
  • The text discusses three approaches to combining overall cost leadership and differentiation competitive advantages. Which of th
    10·1 answer
  • What is the output of the following Python program? try: fin = open('answer.txt') fin.write('Yes') except: print('No') print('Ma
    9·1 answer
  • What is the resistance of 1,000 feet of #16 AWG copper wire?
    6·1 answer
  • Tasked to install additional RAM in a computer. He unplugs the system from the power source and removes the PC cover. What shoul
    15·1 answer
  • Storage that is wiped clean when power is cut off from a device is known as _____.
    13·1 answer
  • How long does it take rblx to re open deleted acc
    8·2 answers
  • What is the next line?
    7·1 answer
  • The<br>tool can lighten the part of an<br>image.*<br>Your answer​
    13·1 answer
  • "To speed up magnetic hard drive performance , ___________ is often used. "
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!