Hello there are 2 questions I need help writing a program in Python language at a beginner
Fantastic news! We've Found the answer you've been seeking!
Question:
Hello there are 2 questions I need help writing a program in Python language at a beginner level.
1) This is a simple introduction to Decisions or if (if/else) statements. You will need two input statements and then a decision statement to compare the values.
Write a program that takes in two integers and outputs the larger value. If the two integers are the same, output the integers' value.
Ex: If the input is:
4 2
the output is:
4
2) Remember you can use the len method to compare the lengths of strings.
Write a program that takes in two strings and outputs the longest string. If they are the same length then output the second string.
Ex. If the input is:
almond pistachio
the output is:
pistachio
Related Book For
Introduction To Leadership Concepts And Practice
ISBN: 9781544351599
5th Edition
Authors: Peter G Northouse
Posted Date: