Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create two objects named a and b. Assign an integer value and a float value to them respectively. Print out the type of the

 

image

Create two objects named "a" and "b". Assign an integer value and a float value to them respectively. Print out the type of the float object, and the sum of the two objects. Exercise 2 - Printing Write a few lines of code that prints out a tic-tac-toe board. Expected output: Exercise 3 - Strings Create four string objects that take the values "Arizona", "State", "University", and "" (a space). Try printing out "Arizona State University" using the four objects (remember one can concatenate strings using the plus sign). Exercise 4 - Importing Libraries In Python, importing libraries is a fundamental concept that allows us to access pre-built functionality and tools to enhance our code. Recall that the syntax for importing libraries is to use the "import" statement. For example, import [library name] Additionally, you can use an alias to give the library a shorter name, making it more convenient to use in your code: import [library name] as [alias] You can also import specific components from a library, rather than importing the entire library, using the from keyboard: from [library name] import [component name] In this class, we will use several important libraries that can aid data analytics, including Numpy, Pandas, matplotlib. Import the first two libraries and name them np", "pd". Import a component named "pyplot" from the third library and name it plt". Try to see if you can successfully import them. Exercise 5 - Operators/Order of Operation Transcribe the following equations into Python (without simplifying!), preserving order of operation with parenthesis as needed. Save each as the value of a variable, and then print the variable. 1. 3x5 2+3 2. 7+9x2 3. (4-7) 4. -19 +100 5. 6 mod 4 If you aren't familiar with modular arithmetic, it is straightforward - the modulus operator, in the expression x mod y, gives the remainder when x is divided by y (use the math module whenever you need it).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intermediate Microeconomics

Authors: Hal R. Varian

9th edition

978-0393123975, 393123979, 393123960, 978-0393919677, 393919676, 978-0393123968

More Books

Students also viewed these Algorithms questions