We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
str1="".join(s.split())
print(str1) #ashutoshdikshit
len1=len(str1) # 15
sq=math.sqrt(len1) #3
r=int(sq) #row =3
c=int(sq)+1 #coloumn=4
p=[(str1[i:i+c]) for i in range(0,len(str1),c)]
print("p",p) #p ['ashu', 'tosh', 'diks', 'hit']
final=[]
for i in range(len(p)-1):
print(len(p)-1)
fc=[]
for j in p:
# print(j)
fc.append(j[i])
final.append(fc)
#print(fc)
print(final)
s=input()
encryption(s)
can u help me with this code
problem i am getting is
last coloumns dont print
eg:
ifmanwas
meanttos
tayonthe
groundgo
dwouldha
vegivenu
sroots
in this aohddn and sseoa wont print .
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Encryption
You are viewing a single comment's thread. Return to all comments →
import math def encryption(s):
s=input() encryption(s)
can u help me with this code problem i am getting is last coloumns dont print eg: ifmanwas
meanttos
tayonthe
groundgo
dwouldha
vegivenu
sroots in this aohddn and sseoa wont print .