answer.
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
madam [21]
2 years ago
13

6.1.5: weather codehs

Computers and Technology
1 answer:
irina [24]2 years ago
6 0

Answer:

6.1.5: weather codehs is a Python code or program platform to find the weather.

Explanation:

<u>Python Program to find the weather of any place</u>:

# Python program to find current  

# weather details of any city  

# using openweathermap api  

# import required modules  

import requests, json  

# Enter your API key here  

api_key = "Your_API_Key"

# base_url variable to store url  

base_url = "http://api.openweathermap.org/data/2.5/weather?"

# Give city name  

city_name = input("Enter city name : ")  

# complete_url variable to store  

# complete url address  

complete_url = base_url + "appid=" + api_key + "&q=" + city_name  

# get method of requests module  

# return response object  

response = requests.get(complete_url)  

# json method of response object  

# convert json format data into  

# python format data  

x = response.json()  

# Now x contains list of nested dictionaries  

# Check the value of "cod" key is equal to  

# "404", means city is found otherwise,  

# city is not found  

if x["cod"] != "404":  

# store the value of "main"  

# key in variable y  

y = x["main"]  

# store the value corresponding  

# to the "temp" key of y  

current_temperature = y["temp"]  

# store the value corresponding  

# to the "pressure" key of y  

current_pressure = y["pressure"]  

# store the value corresponding  

# to the "humidity" key of y  

current_humidiy = y["humidity"]  

# store the value of "weather"  

# key in variable z  

z = x["weather"]  

# store the value corresponding  

# to the "description" key at  

# the 0th index of z  

weather_description = z[0]["description"]  

# print following values  

print(" Temperature (in kelvin unit) = " +

    str(current_temperature) +

 "\n atmospheric pressure (in hPa unit) = " +

    str(current_pressure) +

 "\n humidity (in percentage) = " +

    str(current_humidiy) +

 "\n description = " +

    str(weather_description))  

else:  

print(" City Not Found ")

CodeHS is a comprehensive teaching platform for helping schools teach computer science. The strategic Code HS is to engage all understudies to seriously affect what's to come. They accept that in the 21st century, coding is an essential ability, much the same as perusing and composing. That is the reason it is stated: Perused, Compose, Code. This is finished by giving incredible educational plan, instruments, and assets to instructors, understudies, and schools to execute top notch software engineering programs. They have a conviction that everybody ought to find the opportunity to get the hang of coding, and that it's an expertise that gives boundless innovative chance to understudies. They have a mean to help make software engineering instruction fun and open, and accept everybody are needing both incredible apparatuses just as an extraordinary network to get this going. This is done through their help for instructors, understudies and schools, with the assistance their committed group and stunning guides.

You might be interested in
Andrew is researching a new operating system for the computers at his workplace. His boss wants the computers to be able to conn
Bumek [7]

Answer:

Windows 8.1 Core

Explanation:

In this particular example, we're going to use Windows 8.1 Core, is the most basic of the window's family, in this case, only we need an OS to connect the hardware with the cloud computing for security and is not necessary another license, in addition, Windows 8.1 core is easiest to use, is so friendly with the user.

6 0
2 years ago
At age 16, Cheyenne just got her driver's license. She loves to drive and is thinking of becoming a truck driver, because she he
Ivenika [448]
<span> the answer would be: Does she have or can she develop the strengths needed for this type of work?</span><span />
6 0
2 years ago
Read 2 more answers
In a linux operating system, which component interprets user commands and forwards them to the os?
miv72 [106K]
In a Linux system, the shell is a command-line interface that interprets a user's commands and script files, and tells the server's operating system what to do with them. <span> The shell is a program that takes commands from the keyboard and gives them to the operating system to perform.</span>
6 0
2 years ago
You're helping a group of ethnographers analyze some oral history data they've collected by interviewing members of a village to
Xelga [282]

Answer:

Algorithm given below

Explanation:

<u>Algorithm: </u>

proc create-node( event )

     out-adj-list[event] <- empty-list

     in-degree[event] <- 0

   endproc

   proc create-edge( start, end )

     push( out-adj-list[ start ], end )

     in-degree[ end ] <- in-degree[ end ] + 1

   endproc

   for p \in { P_i }

     create-node( birth[p] )

     create-node( death[p] )

     create-edge( birth[p], death[p] )

   endfor

   for (p, q) \in DiedBefore

     create-edge( death[p], birth[q] )

   endfor

   for (p, q) \in Coexisted

     create-edge( birth[p], death[q] )

     create-edge( birth[q], death[p] )

   endfor

   eligible-node-list <- empty-list

   for p \in { P_i }

     if in-degree[ birth[p] ] = 0

       push(eligible-node-list, birth[p])

     endif

   endfor

   event-date-separation = 200yrs / (2*|{P_i}|)

   order <- 0

   while eligible-node-list is non-empty

     event = pop(eligible-node-list)

     order <- order + 1

     dates[ event ] = START_DATE + order * event-date-separation

     for following-event \in out-adj-list[event]

       in-degree[ following-event ] <- in-degree[ following-event ] - 1

if in-degree[ following-event ] = 0

                       push( eligible-node-list, following-event )

           endif

     endfor

   endwhile

   if order < 2*|{P_i}|

     return INCONSISTENT_DATA

   else

     return CONSISTENT_DATA, dates

   endif

3 0
2 years ago
When a digital signal needs to be transmitted over an analog medium, such as when a computer needs to send digital signals over
quester [9]
A modem is used is your Answer.
8 0
2 years ago
Other questions:
  • If you want more blank white space around the text in a document, you should increase the ____________.
    13·2 answers
  • Dan is a Civil Engineer for a company that builds nuclear power plants throughout the world. Which best describes the places he
    14·2 answers
  • Monica needs to work on a document where she has to highlight topics in bold and add emphasis to some words in a paragraph using
    9·1 answer
  • Which of the following is true of information systems?
    15·1 answer
  • Drag each label to the correct location on the image.
    11·1 answer
  • As part of the duties of a digital forensics examiner, creating an investigation plan is a standard practice. Write a 3 to 4 (no
    9·1 answer
  • Section 6.9 of your textbook ("Debugging") lists three possibilities to consider if a function is not working. Describe each pos
    14·1 answer
  • Consider the following two code segments, which are both intended to determine the longest of the three strings "pea", "pear", a
    7·1 answer
  • Pick a 3D game you enjoy or know about. Pick a scene from that game that has at least one character in it and describe the scene
    9·1 answer
  • A function defined beginning with void SetNegativesToZeros(int userValues[], ... should modify userValues such that any negative
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!