Not register? Register Now!
Essay Available:

Pages:
4 pages/≈1100 words
Sources:
Check Instructions
Style:
Check Instructions
Subject:
IT & Computer Science
Type:
Others
Language:
English (U.S.)
Document:
MS Word
Date:
Total cost:
\$ 10
Topic:

# Writing Program Python and Python Code

Instructions:

pppppppppppppppppppppppppppppppppppppppppppppppppssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssstttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

Content:

Subject: Sp22-bai-025 BASI LAB#1

Write a program that prompts the user to input an integer and then outputs the number with the digits reversed. For example, if the number is 12345, the output should be 54311.

n=input ("Enter an integer")

print("Reverse number of",n,"is",n[::-1])

print("\n")

Output:

Write a program python that reads a set of integers, and then prints the sum of the even and odd integers.

intger_string = input ("Enter several integers ")

sum_even= 0

sum_odd=0

for integer in intger_string.split(" "):

integer = int (integer)

if integer % 2:

sum_odd +=integer

else:

sum_even+=integer

print ("Sum of even integrs is : ",sum_even)

print ("Sum of odd integrs is : ",sum_odd)

Output: