Create two objects named a and b. Assign an integer value and a float value to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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). 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).
Expert Answer:
Related Book For
Posted Date:
Students also viewed these algorithms questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
E. Blood Flow Through the Kidneys Trace blood flow through the kidneys. Start at the renal artery and number the blood vessels in sequence. afferent arteriole arcuate artery arcuate vein efferent...
-
The fund-basis financial statements of Cherokee Library District (a special purpose government engaged only in governmental activities) have been completed for the year 2017 and appear in the second...
-
In each of the following examples, discuss which market model appears to best explain the behavior described: a. Corn prices reached record highs in the United States in August 2012, given the worst...
-
What is a clade?
-
Silva Chairs, Inc. makes two types of chairs. Model Diamond is a high-end product designed for professional offices. Model Gold is an economical product designed for family use. Jane Silva, the...
-
When selecting a banking partner the company must analyze both the Counterparty risk and Operational risk; please provide an example for both risks
-
Emily Jackson (Social Security number 765-12-4326) and James Stewart (Social Security number 466-74-9932) are partners in a partnership that owns and operates a barber shop. The partnership's first...
-
4. Write a MATLAB function that calculates the standard deviation of an array. stddev = Xi n i=1 (x,- mean) n-1 i-th element of the array the length of the array mean the average of the array elements
-
Why so many workers are not protected by the FLSA's minimum wage and overtime protections? Explain briefly
-
You are a paralegal licensee, providing legal services as Justice for All Professional Corporation. Your client, Winston Burrows, formerly worked as a sales clerk in ABC Department Store. In August...
-
What are the ethical basis for public health is utilitarianism or maximizing benefits. ? Quarantine helps prevent catastrophic diseases and mass suffering; however, it infringes on the rights of some...
-
Describe two services provided by the Canadian government to assist Canadian exporters? Explain briefly
-
The Civil Enforcement Bailiff will serve the debtor with a Notice of Seizure and will either remove the goods or leave them upon a Bailee's Undertaking (a sworn promise not to sell, damage, or...
-
Supreme Manufacturing was founded over 35 years ago in East Brunswick, NJ. Supremes Muy Refresc de Tropical line of Horchata, Tamarindo, and Jamaica drinks are lovingly re-created from Latino recipes...
-
What types of inventory issues Starbucks might reflect upon at the end of each year? The mission of Starbucks is to inspire and nurture the human spiritone person, one cup, and one neighborhood at a...
-
The number of bottles of chardonnay demanded per year is $1, 000, 000 60, 000P, where P is the price per bottle (in U.S. dollars). The number of bottles supplied is 40, 000P. (a) What is the...
-
The price elasticity of demand for oatmeal is constant and equal to 1. When the price of oatmeal is $10 per unit, the total amount demanded is 6,000 units. (a) Write an equation for the demand...
-
The demand function for merino ewes is D(P) = 100/P, and the supply function is S(P) = P. (a) What is the equilibrium price? (b) What is the equilibrium quantity? (c) An ad valorem tax of 300% is...
-
Demonstrate that for colors \(r, g\), and \(b\), color \(\mathrm{SU}(3)\) two-quark states are of the form \(q q=\mathbf{3} \otimes \mathbf{3}=\mathbf{6} \oplus \overline{\mathbf{3}}\), with Show...
-
Prove that Eq. (19.34) gives the simplest multi-gluon and gluon-quark states that contain an \(\mathrm{SU}(3)\) color singlet in the decomposition. Data from Eq. 19.34 (GG)1: (88)1 (Gqq) : [8 (383)8]...
-
A textile manufacturer is concerned about the strength of cotton yarn. In order to nd out whether fiber length is an important factor in determining the strength of yarn, the quality control manager...
Study smarter with the SolutionInn App