Created
February 17, 2021 07:35
-
-
Save Deniz97/ed4fc04ef5199f9557f12bb81c6bf92e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adim = "m" | |
level_sayisi = int(input("level sayisini giriniz:")) + 1 | |
if(level_sayisi < 1 or level_sayisi >7): | |
print("geçersiz level sayisi") | |
exit() | |
bas_harfler = [] | |
for i in range(level_sayisi): | |
ad1 = input("level %s, name 1: " %i) | |
ad2 = input("level %s, name 2: " %i) | |
if not ad1.islower() or not ad2.islower(): | |
print("name should be all upper case, exiting") | |
exit() | |
bas_harfler.append((ad1[0], ad2[0])) | |
uzaklik = 2*(level_sayisi) - 1 | |
print("%s%s%s"% (" " * ((uzaklik // 2)+1), adim, " " * ((uzaklik // 2)+1))) | |
# handle rest | |
for i in range(level_sayisi): | |
bosluk_sayisi = (uzaklik // 2) - i + 1 | |
print("%s%s%s%s%s" % (" " * (bosluk_sayisi - 1), bas_harfler[i][0] , "_"* (i*2 + 1) , bas_harfler[i][1] , " " * (bosluk_sayisi - 1) )) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment