Question: Morlule 2 Assignment Part 1 : Getting Started with Variables and Assignments in Python Objective: This assignment will help you understand the basics of variables

Morlule 2 Assignment
Part1: Getting Started with Variables and Assignments in Python
Objective:
This assignment will help you understand the basics of variables and assignments in Python by practicing simple examples.
Instructions:
Creating Variables:
Open your Python IDE or a Jupyter Notebook.
Create three variables: fruit, quantity, and price_per_item.
Assign the following values to these variables:
fruit = "Apple".
quantity =10
price_per_item =0.5
Print the values of these variables.
Performing Calculations:
Create a new variable called total_cost.
Calculate the total cost by multiplying quantity by price_per item.
Print the total_cost.
Updating Variable Values:
Change the value of quantity to 15.
Recalculate the total_cost using the updated quantity.
Print the new total_cost.
Using Multiple Variables:
Create variables num1 and num2 and assign the values 8 and 3 to them, respectively.
Perform the following operations and print the results:
Addition
Subtraction
Multiplication
Division
Morlule 2 Assignment Part 1 : Getting Started

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!