0% found this document useful (0 votes)
19 views5 pages

Input Output

Uploaded by

eyjwtksykeynsf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views5 pages

Input Output

Uploaded by

eyjwtksykeynsf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

input_output

1. Write a code to get the input in the given


format and print the output in the given format
Input Description: To take an integer value

Output Description: Print the integer value

Sample Input : 2

Sample Output : 2

num = int(input())

print("output")

print(num)

2
output
2

[Link] a code to get the input in the given


format and print the output in the given format
Input Description: A single line contains integers separated by space

Output Description: Print the integer list of integers separated by space

Sample Input : 2 3 4 5 6 7 8

Sample Output : 2 3 4 5 6 7 8

num1 = input() # to take an input function


print("output")
print(num1)

2 3 4 5 6 7 8
output
2 3 4 5 6 7 8
[Link] a code to get the input in the given
format and print the output in the given format.
a = input()
b = input()
print("output")
print(a)
print(b)

5 3
1 2 3 4 5
output
5 3
1 2 3 4 5

[Link] a code to get the input in the given


format and print the output in the given format
print("input")
num1 = input()

num2 = input()

num3 = input()

print("output")

print(num1)

print(num2)

print(num3)

input
2 4
2 4
3 5
output
2 4
2 4
3 5
[Link] a code to get the input in the given
format and print the output in the given format
a = int(input())

b = int(input())

c = int(input())

print("output")

print(a,b,c)

2
4
5
output
2 4 5

[Link] a code to get the input in the given


format and print the output in the given format
a = input()

b = input()

c = input()
print("output")
print(a)

print(b)

print(c)

2 5
2 5 6
2 4 5
output
2 5
2 5 6
2 4 5
[Link] a code to get the input in the given
format and print the output in the given format
str = input()

print("output:")
print(" ".join(str))

mohan
output:
m o h a n

8. Write a code to get the input in the given


format and print the output in the given format.
flo = input().split(" ") # 2.3 4.5 7.8

#print(flo) ['2.3', '4.5', '7.8']


print("Output")

for t in flo:

print(t)

2.3 4.5 7.8


Output
2.3
4.5
7.8

[Link] a code to get the input in the given


format and print the output in the given format.
str1 = input()

for i in str1 :

print(i)

guvigeek
g
u
v
i
g
e
e
k

[Link] a code to get the input in the given


format and print the output in the given format.
str3 = input()

print(",".join(str3))

guvi
g,u,v,i

You might also like