Mundo em Python

Alternado

import time

def mostrar_seccoes(val1, val2):
print("Secção 1 Secção 2")
print(f" {val1} {val2}") def animar_troca(a, b):
mostrar_seccoes(a, b)
time.sleep(2)
mostrar_seccoes(2, 2)
time.sleep(2)
mostrar_seccoes(b, a)
time.sleep(2) def main():
a, b = 1, 3
while True:
animar_troca(a, b)
a, b = b, a
if __name__ == "__main__":
main()
0