| University | Singapore University of Social Science (SUSS) |
| Subject | FIN551: Python Programming |
(a) Write statements for the following tasks:
(i) Given a 2-digit whole number, n, display the message Valid if n contains the digit 1. For example, 10, 11 and 31 are valid but 33, 34 and 35 are not. Do not convert n into a string.
(ii) Given that string s has exactly 3 characters. Display the message Group A if characters in the first, middle and last positions are the same. For example, if s is ‘222’, display Group A. Display message Group B if the first and last characters are the same but the middle character is different. For example, if s is ‘232’, display Group B. Display message Group C if the first and last characters are not the same. For example, if s is ‘223’ or ‘213’, display Group C.
(iii) Given a list of numbers, nList such as [1, 3, 2]. If the sum of digits in the even position is even, display the message Sum of digits in even positions is even. Otherwise, display the message Sum of digits in even positions is odd. Do not use loop/repetition structure. Instead, use the slice operator and the built-in function sum.
(b) Given a string, s that contains a sequence of digits.
(i) Write a code segment that picks each digit in the string in reverse order, reduces each digit by 1 and displays the resulting number on separate lines. The code segment should produce the output for a given string ‘1204’: 3
-1
1
0
(ii) Write a code segment that prints the message True if the sum of each pair of adjacent digits does not exceed 12. Print the message False otherwise. For illustration, suppose the string s has 5 digits: d0d1d2d3d4. If d0 + d1, d1 + d2, d2 + d3, d3 + d4 do not exceed 12, the code segment prints True. Thus, for the string ‘48531’, the code segment prints the message False because the sum of pair of adjacent digits 85, or 8+5 exceeds 12.
Buy Custom Answer of This Assessment & Raise Your Grades
Are you searching for someone to do my assignment? then don't stress at Singapore Assignment Help we have proficient suss assignment experts who have an amazing capability to design outstanding solutions on FIN551: Python Programming Assignment. Our experts work 24*7 hours to provide all assignment answers before the deadline.
Looking for Plagiarism free Answers for your college/ university Assignments.
- NCO205 User-Centred Design: Human Factors and Design Thinking Tutor-Marked Assignment-01 Semester July 2025
- ECE200 Supporting Sensory and Motor Development End-of-Course Assessment – July Semester 2025
- 7WBS2007-0901-2025 Human Resource Management Assignment 2 Brief 2025
- Bachelor of Engineering in Electrical and Electronic Engineering Assignment Brief
- MKT373 Strategic Content Management End-of-Course Assessment – July Semester 2025
- HRM335 Leadership Development End-of-Course Assessment – July Semester 2025
- EL1101E The Nature of Language Individual Essay Guidelines Semester 1, AY2025/2026
- The Problem of Poverty Essay – Comparing Differential Association and General Strain Theories
- EMT223 Venue Management in Performing Arts Spaces Tutor-Marked Assignment 02 July 2025 Presentation
- FinTech Individual Assignment: Power Dynamics and Climate Transparency in Digital Carbon Markets
