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 Assignment
Part: 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 priceperitem.
Assign the following values to these variables:
fruit "Apple".
quantity
priceperitem
Print the values of these variables.
Performing Calculations:
Create a new variable called totalcost
Calculate the total cost by multiplying quantity by priceper item.
Print the totalcost
Updating Variable Values:
Change the value of quantity to
Recalculate the totalcost using the updated quantity.
Print the new totalcost
Using Multiple Variables:
Create variables num and num and assign the values and to them, respectively.
Perform the following operations and print the results:
Addition
Subtraction
Multiplication
Division
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
