0% found this document useful (0 votes)
16 views12 pages

Python Programming Overview in Hindi

The document outlines the curriculum for the COM4302 module, focusing on Computer Science Fundamentals, which includes creating a job specification for an Entry-Level Python Programmer, roles beyond coding, and developing a simple calculator using flowcharts and pseudocode. It also covers coding practices in Python, including variables, data structures, and functions, along with explanations of each code section. Additionally, it provides references and an appendix with Python results.

Uploaded by

HASIN ORTHI
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views12 pages

Python Programming Overview in Hindi

The document outlines the curriculum for the COM4302 module, focusing on Computer Science Fundamentals, which includes creating a job specification for an Entry-Level Python Programmer, roles beyond coding, and developing a simple calculator using flowcharts and pseudocode. It also covers coding practices in Python, including variables, data structures, and functions, along with explanations of each code section. Additionally, it provides references and an appendix with Python results.

Uploaded by

HASIN ORTHI
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Module Number: COM4302

Module Name: Computer Science Fundamentals

Student’s name: xxxxxx xxx


Contents
Part 1 - Writing............................................................................................................................................3
Create a Programmer’s Job Specification Document...............................................................................3
List and Describe Programmer’s Roles Beyond Coding..........................................................................3
Create a Flowchart and Pseudocode for a Simple Calculator..................................................................4
List and Describe Requirements for an Interactive Device......................................................................6
Part 2 – Coding............................................................................................................................................6
Code........................................................................................................................................................6
Explanation............................................................................................................................................10
References.................................................................................................................................................11
Appendix...................................................................................................................................................12
Python results........................................................................................................................................12
Part 1 - Writing
Create a Programmer’s Job Specification Document
This part describes the significant tasks and requirements of the Entry-Level Python Programmer
position in the Software Development field. Supervised by a Team Lead/Senior Developer, this
position involves code implementation, validation, and quality assurance by the business
industry premium Python code benchmark. Successful candidates will work with cross-
functional teams to identify the project's needs and implement successful solutions. They will
make good players in code reviews, and some even contribute to enhancing code quality and
compliance with standard practices. Note that both candidates should have a strong learning
attitude and embrace new technologies and paradigms in programming. Accountabilities include
the ability to write clean, well-documented, and maintainable Python code, work through the
entire software development life cycle, isolate and fix bugs, test software components
comprehensively, and contribute to a shared knowledge base of other developers in the team.
Ideal candidates will have a Bachelor’s degree in Computer Science, Software Engineering, or
any related field and a good working knowledge of Python, including data structures, algorithms,
and object-oriented programming. Previous experience with most known Python libraries and
frameworks, including Pandas, NumPy, Django, Flask, etc., and an understanding of version
control methodologies, such as Git, are always welcome. For this type of employment, it is vital
to have good problem-solving and analytical abilities; strong communication and interpersonal
skills are also essential, as well as driving passion and desire in software development.

List and Describe Programmer’s Roles Beyond Coding


Although coding is mandatory, good programmers go beyond coding skills and much more. They
are responsible team players, able to translate and share technical contexts with technical and
non-technical individuals and organizations, and receptive to the needs and expectations of
customers and work members. Excellent logic and reason will be the key areas of success. They
will solve technical problems like software bugs in applications, design problems, and
architecture issues while creating high-performance and reliable software systems and conjecture
potential shortcomings in the requirements and ways to address them. Specific management
competencies for the project include timely management of projects, particularly estimating
time, and taking an active role in project planning and implementation with an eye on efficiency
and cost control. Keeping learning is crucial; the employee should always be ready to update
themself with the latest trends in technology and professionalism, enhancing the acquisition of
new skills to come in as a mentor or coach junior developers when need be.

Create a Flowchart and Pseudocode for a Simple Calculator


This section outlines the steps in creating a simple calculator using a flowchart and pseudocode.
Flowchart:

[Start]
|
v
[Display "Enter the first number:"]
|
v
[Read the first number]
|
v
[Display "Enter the second number:"]
|
v
[Read the second number]
|
v
[Display "Select operation (+, -, *, /):"]
|
v
[Read operator]
|
v
[Decision: operator?]
| | |
| | |
"+" "-" "*"
| | |
v v v
[result = first number + second number]
[result = first number - second number]
[result = first number * second number]
|
v
[Decision: operator == "/"?]
|
/\
/ \
Yes No
| |
v v
[Decision: second number == 0?]
| |
Yes No
| |
v v
[Display "Error: Division by zero."]
[result = first number / second number]
|
v
[Display "Result: " + result]
|
v
[End]
Pseudocode:

Get the first number from the user

Get the second number from the user

Get the operator from the user

If operator is "+":

Calculate the result as first number + second number

Else if the operator is "-":

Calculate the result as a first number - second number

Else if the operator is "*":

Calculate the result as first number * second number

Else if the operator is "/":

If the second number is 0:

Display "Error: Division by zero."

Else:

Calculate the result as the first number / second number

Display the result


List and Describe Requirements for an Interactive Device
This section focuses on the essential targets relevant to the interactive device design and its
development. Functionality objectives are the conceptual description of primary operational
tasks, the user's decision to interact with interfaces (touch screen, buttons, voice), and the
device's ability to connect to the target populace. The issues of hardware related to choosing an
adequate processor depending on the computations needed, defining the storage space required
for data as well as program execution, and adding suitable sensors, such as touch sensors,
accelerometers, temperature sensors, etc., for interaction with the user, and choosing a proper
power supply including a battery or an external power supply with sufficient battery life.
Software issues encompass decisions as to the operating system for the gadget, the design of the
Graphical User Interface, and the integration of the hardware connectivity solutions, for instance,
wireless communication through a Wi-Fi or Bluetooth, or cellular network. Technical and
aesthetic aspects concerns include choosing designs that are comfortable to handle conveniently
and look good to the targeted consumer base and the ability of this choice to stand the rigors of
day-to-day use. Last, general safety and security compliance requires following all the safety and
security rules set for an application and involving cautiously secure methods for user’s data
security.

Part 2 – Coding
Code
# Code 6 - Variables and Data Types

# Store the city name as a string

city_name = "London"

# Define variables for storing weather data

temperature = 25.0 # In Celsius

humidity = 60.0 # In percentage

weather_description = "Sunny"

# Code 7 - Operators in Python

# Format the city name and weather details

weather_report = f"Weather in {city_name}:\n" \


f"Temperature: {temperature:.1f}°C\n" \

f"Humidity: {humidity:.0f}%\n" \

f"Condition: {weather_description}"

# Code 8 - Data Structures

# Create a dictionary to store weather data for the current city

weather_data = {

"city": city_name,

"Temperature": temperature,

"humidity": humidity,

"description": weather_description

# Create a list to store weather data for multiple cities

cities_weather = [

"city": "New York",

"Temperature": 28.0,

"humidity": 75.0,

"description": "Cloudy"

},

weather_data

# Code 9 - Python Selection Statements

# Simulate an API call and handle potential errors

api_success = True # Replace with actual API call result

if api_success:

print("API call successful.")

print(weather_report)

Else:
print("Error: Failed to fetch weather data.")

# Code 10 - Python Loops

# Loop through the list of cities and display their weather data

for city_weather in cities_weather:

print(f"Weather in {city_weather['city']}:")

print(f"Temperature: {city_weather['temperature']:.1f}°C")

print(f"Humidity: {city_weather['humidity']:.0f}%")

print(f"Condition: {city_weather['description']}")

print("-" * 20)

# Code 11 - (Optional) Python Functions

def fetch_weather_data(city):

"""

This function simulates fetching weather data from an API.

In a real-world scenario, this would involve making an

actual API call (e.g., to OpenWeatherMap).

Args:

City (str): The name of the town.

Returns:

dict: A dictionary containing the weather data

for the specified city or None if the API call fails.

"""

# Simulate API call (replace with actual API call logic)

if city == "London":

return {

"Temperature": 23.0,
"humidity": 55.0,

"description": "Partly Cloudy"

elif city == "Paris":

return {

"Temperature": 20.0,

"humidity": 62.0,

"description": "Rainy"

Else:

Return None # Indicate API call failure

def display_weather(city, weather_data):

"""

Displays the weather information for a given city.

Args:

City (str): The name of the town.

weather_data (dict): A dictionary containing the weather data.

"""

if weather_data:

print(f"Weather in {city}:")

print(f"Temperature: {weather_data['temperature']:.1f}°C")

print(f"Humidity: {weather_data['humidity']:.0f}%")

print(f"Condition: {weather_data['description']}")

Else:

print(f"No weather data available for {city}.")

# Example usage of the functions


city_to_check = "London"

weather_data = fetch_weather_data(city_to_check)

display_weather(city_to_check, weather_data)

Explanation
Code 6: Creates String variable for City Name and floating variables for temperature, humidity, and
weather description, respectively.

Code 7: Uses f-strings to cast out the weather info so that it is more readable.

Code 8: First, a dictionary is defined to store the daily weather data of a city, and an array is used to store
one or multiple city-data.

Code 9: Uses an if-else statement to first check on the status of the called API and, in case of an error,
then shows an error message.

Code 10: This code uses a for loop to go through the list of cities and display their respective amounts of
weather.

Code 11: Defines two functions:

fetch_weather_data(): Imitates an API call to fetch weather data (refurbished with actual API call
functionality).

display_weather(): Formats the weather information for better looking or to fit into a set layout.
References
OpenWeatherMap. (n.d.). API Documentation. Retrieved January 14, 2025, from
[Link]

Python Software Foundation. (n.d.). The Python Standard Library. Retrieved January 14, 2025, from
[Link]

Smith, J. (2021). Python Programming Essentials. 3rd Edition. CodePress Publications.


Appendix
Python results

You might also like