Answers for "temp variable python"

16

swapping in python

x = 5
y = 10

x, y = y, x
print("x =", x)
print("y =", y)
Posted by: Guest on May-30-2020
9

code to swap in python

a=5
b=10
a,b=b,a  #swapped
Posted by: Guest on May-13-2020
0

temp variable python

c = input(" ")
temp = {}
output = " "
for x in c:
    if x in temp:
        temp[x] = temp[x] + 1
    else:
        temp[x] = 1
for key, value in temp.items():
    output += str(value) + str(key)
print(output)
Posted by: Guest on September-29-2021

Python Answers by Framework

Browse Popular Code Answers by Language