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
madam [21]
3 years ago
13

6.1.5: weather codehs

Computers and Technology
1 answer:
irina [24]3 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
Which of the following describes the operating system
Marianna [84]

Answer:

Explanation:

you added no options

5 0
3 years ago
Why is UDP less reliable than TCP?
borishaifa [10]

Answer:

a.) UDP does not include data reassembly.

7 0
3 years ago
Read 2 more answers
Write 10 steps to make your presentation more effective
Over [174]
For me the some steps I use not 10 steps sorry are I always go through the slide and think what I am talking about. You have to understand what you are talking about and be clear and persuasive. Never look at the presentation. Memorize key phrases and keep your eyes at your audience. make each of your slides colorful so viewers will look at your actually slide.
4 0
3 years ago
Which things computer case contains
Ronch [10]

Inside the case are the components that make up the computer itself, such as the RAM memories, the processor and the hard disk, all of which are directly or indirectly connected to the motherboard. In addition, the case allocates the power suplly, which is responsible for supplying power to the computer.

<h3>What is a computer case?</h3>

The case is the hardware component used to house most parts of a computer. It is inside it that components such as CPU, motherboard, SSD, video card and power supply are placed.

In addition, it is where the outputs for connections to other equipment are found, such as USB and HDMI outputs, plug for sound box and microphone and input for memory card.

The case has the important function of protecting the internal components of a computer from knocks, heat, light, moisture and dust. That's because most of the electronic components inside a computer are very sensitive and need this protection.

It is also used to connect to other hardware components, such as a monitor, keyboard, mouse and headset, through the various outputs provided on its exterior.

See more about computing at: brainly.com/question/15707178

#SPJ1

5 0
2 years ago
Three PCs are on an Ethernet LAN, connected by a hub. Describe how the Ethernet protocol deals with collisions in this situation
sdas [7]

Answer:

All the ports in a hub are in the same collision domain and a hub sends frames from one host to all other hosts in the network. This makes it prone to collision and poor network throughput. Just like a network switch, it uses the CSMA/CD protocol to detect collision in its network.

A network switch reduces its collision domain to just a port and sends frames from one host to another using its mac table as a route. This makes the network very efficient with high throughput. It also uses the CSMA/CD protocol to detect collision

Explanation:

Switches and hubs are used in networking to connect computer devices in a network. A hub is an obsolete device networking that broadcast a frame to all other ports or host in the network except for the send host port. This increases the rate of collision as all the ports in a hub share the same collision domain. A switch is an efficient frame switching device in a network, which uses its MAC table to decide and find a destination host.

CSMA/CD is a collision detection protocol used in a network to detect and prevent a collision. With this protocol, a host is able to listen, wait, send and resend frames to prevent a collision.

3 0
3 years ago
Other questions:
  • What is the Multiple Source Test
    15·2 answers
  • Since the password includes all four types of characters (complex password) and is 8 characters long, what is the real reason th
    10·1 answer
  • How can you clean out the scales in an electric iron without taking the iron apart? A. By rinsing the tank and holes with a wate
    12·2 answers
  • What are the Database used in RDBMS and DBMS<br>please answer immediately​
    10·1 answer
  • What will the following code display? #include using namespace std; void doSomething(int); int main() { int x{2}; cout &lt;&lt;
    9·1 answer
  • What is the function of the NOS? Select all that apply.
    5·2 answers
  • Potential Energy and Kinetic Energy both mean "energy in motion" True or False​
    8·2 answers
  • Can maybe someone play with me on Over-watch on the Xbox?
    8·1 answer
  • Select the correct answer. Which input device uses optical technology?
    5·1 answer
  • The optical phenomenon that allows us to view rapidly changing still images as moving images is called _______.
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!