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
4vir4ik [10]
3 years ago
15

Print even numbers till 50 in python coding.

Computers and Technology
1 answer:
e-lub [12.9K]3 years ago
4 0

In python, you can use a simple list comprehension to solve this problem.

print([x for x in range(51) if x % 2 == 0])

This code prints all the even numbers from 0 to 50 including 0 and 50.

You might be interested in
a. Your program generates a random number between 0 and 128 and keeps asking the user to guess the number until the user guesses
geniusboy [140]

Answer:

import random

arr=[]

frr=open("score.txt","w")

for i in range(128):

   arr.append(i)

def func1(lst):

   score=0

   name=input("enter your name: ")

   while True:

       answer=random.choice(arr)  

       guess=int(input("enter your guess number between 0-128: "))

       if answer is guess:

           print("right guess\ncongratulations.....")

           print("the answer was: "+str(answer))

           score+=1

           break

       elif guess < answer-20:

           print("you guessed too low....\ntry again")

           print("the answer was: "+str(answer))

       elif guess > answer+20:

           print("you guessed too high....\ntry again")

           print("the answer was: "+str(answer))

       else:

           print("incorrect guess\ntry again")

           print("the answer was: "+str(answer))

       ext=int(input("press 0 to exit:\npress 1 to continue: "))

       if ext is 0:

           break

       

   return "{} {}".format(name,score)

num=int(input("how many users will be taking part: "))

for i in range(num):

   frr.write("{}\n".format(func1(arr)))

frr.close()

frr1=open("score.txt","r")

line=frr1.readline()

while line:

   print(line)

   line=frr1.readline()          

frr1.close()    

Explanation:

this code is in python3 language

it is displaying the name and the score, you just need to adjust the top 3 scores and least 3 scores.

3 0
4 years ago
When you increase the screen resolution, windows displays less information on the screen, but the information is larger. true or
leonid [27]
When you increase resolution, say from 1024x768 to 1280x1024, you have more pixels crammed into the same space. The info is still the same number of pixels in size.
4 0
3 years ago
Which threat hunting technique is best suitable when handling datasets that creates limited number of results
Pepsi [2]

Answer:

Stacking

Explanation:

Threat hunting is searching through networks and datasets to see if their are suspicious or activities that are risky.

Stacking has to do with counting the frequency the frequency of occurrences for those values that are of o particular type. And then making an analysis) examination of the outliers of these results.

When the dataset is large or diverse, the effectiveness of the stacking technique reduces. It is best used with datasets that would give a finite number of results.

3 0
3 years ago
how could environmental and energy problem Kenya faces as far computer installations are concerned be avoided​
ipn [44]

The environmental and energy problem Kenya faces as far computer installations are concerned can be avoided​ by

  • Knowing and finding out the key aspect of ICT strength.
  • Create an holistic judgements in the assessment of ICT capability. Promote the use of solar power.

<h3>How can we overcome ICT challenges?</h3>

There are a lot of Energy Challenges in terms of ICT  in Kenyan and it is good the government and the people work towards energy in terms of sustainable ICT.

Therefore, The environmental and energy problem Kenya faces as far computer installations are concerned can be avoided​ by

  • Knowing and finding out the key aspect of ICT strength.
  • Create an holistic judgements in the assessment of ICT capability. Promote the use of solar power.

Learn more about computer installations from

brainly.com/question/11430725

#SPJ1

7 0
2 years ago
A negative effect of computer technology's role in creating images is that:
otez555 [7]

Answer:

Personally would go with D.

Information being shared could be both good and bad but it all would be about the situation and if it was private information or not.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Information Can Be Gathered Regarding The Temperature Of A Substance And Uploaded To A Computer Using A ___________ As A Data Co
    6·1 answer
  • If a security officer is non-commissioned officer, he can carry a baton on duty if he went through a training class
    8·1 answer
  • A television advertisement claiming that a product is "light-years ahead of its time" does not make sense because (a) it doesn’t
    10·1 answer
  • Q) CITY column of a table contains information such as Bangalore , Bangalore-64 , Bangalore-56001 , Mumbai - 400002 etc in order
    8·1 answer
  • Subana is writing a program which will calculate the mean average of a set of numbers by adding the numbers and dividing the res
    11·2 answers
  • You can use your student ID card to get discounts in all of the following except
    6·2 answers
  • What are the classifications of computer
    9·1 answer
  • Hurry i need help What would provide structured content that would indicate what the code is describing ?
    12·1 answer
  • Sub to splashy
    14·2 answers
  • Which model allows designers to use a graphical tool to examine structures rather than describing them with text?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!