Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using python Challenge 3: Mount Everest is very high. A common sign of altitude sickness is dizziness and nausea. When mountaineers reach camp 5, there

image text in transcribed

image text in transcribed

using python

Challenge 3: Mount Everest is very high. A common sign of altitude sickness is dizziness and nausea. When mountaineers reach camp 5, there is a high chance that they will experience altitude sickness. In this challenge, we want to mentally prepare mountaineers for what to expect once they start climbing! INPUT: First, use the input() function to ask "Tell me about your favorite hobby in one sentence: " There are no limits as to what they can type. Store their input into a new variable called my_input. PROCESSING AND OUTPUT: Print out the original my_input. Calculate whether my_input has an odd or even number of characters. Hint! You'll need to use an arithmetic operator for this. If an even number of characters, print "At camp 5, you'll get nausea and will only see half of your vision!" Use a loop to print only the even numbered characters in my_input. E.g. This means if they typed "climbing", we could print only the characters at even positions, like position 0, 2,4,6. So we would print "cibn". Make sure all characters print on the same line. If an odd number of characters, print "At camp 5, you'll get dizziness and will see things backwards!". Using a loop, print my_input backwards. Make sure all characters print on the same line. Afterwards, print a new empty line for code readability. NOTE! Because we are practicing how to write loops and strings, DO NOT use string slicing here! Even though string slicing is a perfectly good solution to solve this problem, in Assignment 2, we want you to practice loops and strings. So you must use a loop to iterate over characters in a string! (You will lose points if you use string slicing). (See next page for sample input and output) SAMPLE INPUT AND EXPECTED OUTPUT: Tell me about your favorite hobby in one sentence: climbing my_input: climbing At camp 5, you'll get nausea and will only see half of your vision! cibn helenaihe@helenaihe-ThinkPad-E470:-/Desktop/Python1105/1105$ python3 p2_4.py Tell me about your favorite hobby in one sentence: reading ny_input: reading At camp 5, you'll get dizziness and will see things backwards! gnidaer helenaihe@helenaihe-ThinkPad-E470:-/Desktop/Python1105/1105$ python3 p2_4.py Tell me about your favorite hobby in one sentence: eating my_input: eating At camp 5, you'll get nausea and will only see half of your vision! etn

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions