Giter Club home page Giter Club logo

lab_dictionary's Introduction

LAB_DICTIONARY

Q1:Build a phone book program that receives the phone number (Use Input to let the user provide the number), and returns the name of the owner.

You can follow the table below:

Name Number
Amal 0568323222
Mohammed 0522222232
Khadijah 0532335983
Abdullah 0545341144
Rawan 0545534556
Faisal 0560664566
Layla 0567917077
  • If the number exists, print the owner. Otherwise, print "Sorry, the number is not found".
  • If the number is less or more than 10 numbers, print "This is invalid number".
  • If the number contains letters or symbols, print "This is invalid number".

Q2:Write a function that receives a list containing the following numbers :

  • [5, 0, 34, 9, 0, 13, 8]
  • rearranges the list so that the zeros are the end of the list, and finally returns the arranged list.

Bonus (use a new file)

Exercise: Weather Data Aggregation

Objective: Write a Python program that aggregates weather data for different cities and provides weather data based on user queries.

Requirements:

  1. Input Weather Data: Allow the user to input weather data for different cities. Each entry should include the city name, date, temperature, humidity, and weather condition (e.g., sunny, rainy).
  2. Store Data in a Dictionary: Use a nested dictionary to store the weather data. The outer dictionary's keys will be the city names, and the values will be another dictionary containing date and weather details.
  3. Query by City: Allow the user to query the weather data by city name, displaying all the recorded weather data for that city.

Guidelines:

  • Use nested dictionaries to store the weather data efficiently.
  • Implement separate functions for inputting data, querying by city.
  • Validate user inputs to ensure correctness.

Challenge:

  • Extend the program to allow the user to update or delete weather data for a specific city and date.

lab_dictionary's People

Contributors

aqeel-aleid avatar newta105 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.