Algorithm,flow chart and pseudocode for sequence of comma separated numbers
s = str(input("Enter few numbers separated by coma: "))
s = s.split(",")
nums=[]
for r in range(0,len(s)):
nums.append(int(s[r]))
print(nums)
Pseudocode:
- Enter few numbers in a string separated by comas
- Split the string using delimiter “,”
- Create a blank integer array named nums
- Fill the nums with integers by converting s elements in int
- Display the nums
Comments
Leave a comment