Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with Python lab exercises. Please help me with the coding and how to respond to the explanation questions. I already tried to

I need help with Python lab exercises. Please help me with the coding and how to respond to the explanation questions. I already tried to code but is giving me a syntax error

Someone Said

Find a quote that you like. Store the quote in a variable, with an appropriate introduction such as "Ken Thompson once said, 'One of my most productive days was throwing away 1000 lines of code'". Print the quote.

First Name Cases

Store your first name, in lowercase, in a variable.

Using that one variable, print your name in lowercase, Titlecase, and UPPERCASE.

Full Name

Store your first name and last name in separate variables, and then combine them to print out your full name.

About This Person

Choose a person you look up to. Store their first and last names in separate variables.

Use concatenation to make a sentence about this person, and store that sentence in a variable

Print the sentence.

Name Strip

Store your first name in a variable, but include at least two kinds of whitespace on each side of your name.

Print your name as it is stored.

Print your name with whitespace stripped from the left side, then from the right side, then from both sides.

Arithmetic

Write a program that prints out the results of at least one calculation for each of the basic operations: addition, subtraction, multiplication, division, and exponents.

Order of Operations

Find a calculation whose result depends on the order of operations.

Print the result of this calculation using the standard order of operations.

Use parentheses to force a nonstandard order of operations. Print the result of this calculation.

Long Decimals

On paper, 0.1+0.2=0.3. But you have seen that in Python, 0.1+0.2=0.30000000000000004.

Find at least one other calculation that results in a long decimal like this.

Neat Arithmetic

Store the results of at least 5 different calculations in separate variables. Make sure you use each operation at least once.

Print a series of informative statements, such as "The result of the calculation 5+7 is 12."

Neat Order of Operations

Take your work for "Order of Operations" above.

Instead of just printing the results, print an informative summary of the results. Show each calculation that is being done and the result of that calculation. Explain how you modified the result using parentheses.

Long Decimals - Pattern

On paper, 0.1+0.2=0.3. But you have seen that in Python, 0.1+0.2=0.30000000000000004.

Find a number of other calculations that result in a long decimal like this. Try to find a pattern in what kinds of numbers will result in long decimals.

#Someone Said

quote=`Ken Thompson once said, `One of my most productive days was throwing away

1000 lines of code```

print(quote)

#First Name Cases

name='isary'

print('In lower case:',name)

print('In Titlecase: ',name.title())

print('In Uppercase',name.upper())

#Full Name

first_name='Isary'

last_name='Fernandez'

#About This Person

full_name=first_name+' '+last_name

print(full_name)

ideal_first_name='Ken '

ideal_last_name='Thompson'

sentence=ideal_first_name+ideal_last_name+' was gifted '

print(sentence)

#name strip

first_name=' Isary '

print(first_name)

print(first_name.lstrip())

print(first_name.rstrip())

print(first_name.strip())

#Arithmeic

first_number=78.5

second_number=8.5

print('Addition: ',(first_number+second_number))

print('Subtraction: ',(first_number-second_number))

print('Division: ',(first_number/second_number))

print('Multiplication: ',(first_number*second_number))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions