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 statements best describes IT careers?
DiKsa [7]

The answer is (C) IT careers are found in a wide variety of industries.

Nowadays, all types of industries in various different parts of the world will have an IT (information technology) department because it is needed, since most businesses operate using some form of IT equipment, which, most commonly found is a computer. It is a particularly lucrative field because of the wide array of job availability.

7 0
3 years ago
Recursively computing the sum of the first n positive odd integers, cont. About (a) Use induction to prove that your algorithm t
julia-pushkina [17]

The recursive function would work like this: the n-th odd number is 2n-1. With each iteration, we return the sum of 2n-1 and the sum of the first n-1 odd numbers. The break case is when we have the sum of the first odd number, which is 1, and we return 1.

int recursiveOddSum(int n) {

 if(2n-1==1) return 1;

 return (2n-1) + recursiveOddSum(n-1);

}

To prove the correctness of this algorithm by induction, we start from the base case as usual:

f(1)=1

by definition of the break case, and 1 is indeed the sum of the first odd number (it is a degenerate sum of only one term).

Now we can assume that f(n-1) returns indeed the sum of the first n-1 odd numbers, and we have to proof that f(n) returns the sum of the first n odd numbers. By the recursive logic, we have

f(n)=f(n-1)+2n-1

and by induction, f(n-1) is the sum of the first n-1 odd numbers, and 2n-1 is the n-th odd number. So, f(n) is the sum of the first n odd numbers, as required:

f(n)=\underbrace{\underbrace{f(n-1)}_{\text{sum of the first n-1 odds}}+\underbrace{2n-1}_{\text{n-th odd}}}_{\text{sum of the first n odds.}}

6 0
3 years ago
Performance problems in a computer system are usually due to ____ problems.
AfilCa [17]
Performance problems in a computer system are usually due to hardware & software problems.
6 0
2 years ago
Describe the certifications developed by SANS. How are they different from InfoSec certifications like CISSP and SSCP?
Nat2105 [25]

Answer:

The certification developed by the SANS is GIAC certification .In this there are 3 certification GSEC,GISF and GCED .The description of these certification is given below .

Explanation:

The GIAC certification course is providing the knowledge of the security like cryptography ,networkig knowledge etc .

GSEC:The GSEC Certification is the certification of the security.It simply means this certification certified about the security risk in the computer system .

GISF: This certification gives the knowledge of the networking as well as the security in the computer system also it gives the knowledge of the cryptography.

GCED :This certification is also providing the knowledge of security as well as networking.

Difference between GIAC and  InfoSec certifications is given below

  • The SANS certification is giving the knowledge about the security risk as well as cryptography by the professional where as the InfoSec certifications providing the knowledge of the hacking by the professional .
  • The SANS is including the certification of  GIAC certification where as the InfoSec certifications is including the  CISSP and SSCP certification .
4 0
3 years ago
How to revive a computer if it functions in an unexpected manner?
julsineya [31]
This would depend on the issue the computer is having. 

In many cases though a simple reboot does the trick. 

If your computer is slow and glitches, try cleaning it for viruses and also clean the fans. If they are dusty the computer can overheat and that can cause it to slow while its working harder to cool down.

In other cases you may not be running the proper software compatible with your device, or programs may be outdated. Check online with the company that manufactured your computer to see if you need to install updates or change certain software. 

3 0
2 years ago
Other questions:
  • You are running an application in Google App Engine that is serving production traffic. You want to deploy a risky but necessary
    9·1 answer
  • What are some of the issues that organizations need to be aware of when designing and managing data?
    8·1 answer
  • Who can help me with 50 varables on codeskulptor​
    8·1 answer
  • Which of these are forms of data? Check all that apply.
    8·2 answers
  • An expression which combines variables numbers and at least one operation
    8·1 answer
  • The editing of digital photos us about the same level of difficulty as editing an analog photo
    12·1 answer
  • A real estate office handles 50 apartment units. When the rent is $600 per month, all the units are occupied. However, for each
    14·1 answer
  • Which of the following is primarily operated by a touchscreen?
    5·1 answer
  • Place the steps for attaching a file to a message in order from top to bottom.
    12·1 answer
  • Hiding/masking personal identifiers from a data set, so that the data set can never identify an individual, even if it is correl
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!