+ 15
Code for registration system python for intermediate
Please help for this code
14 odpowiedzi
+ 18
Hi this is the code....
Follows:
try:
name = input()
#your code goes here
count=0
for i in name:
count+=1
if count > 3:
print("Account Created")
else:
raise Exception
except:
print("Invalid Name")
+ 5
Ok
+ 4
This works too:
try:
name = input()
#your code goes here
if len(name) < 4:
raise ValueError
except:
print("Invalid Name")
else:
print("Account Created")
+ 4
name = input()
x = len(name)
if x > 3:
print('Account Created')
else:
print('Invalid Name')
+ 3
try:
name = input()
#your code goes here
if len(name)>=4:
print("Account Created")
else:
raise Exception
except:
print("Invalid Name")
+ 1
try:
name = input()
if len(name) > 3:
print("Account Created")
else:
raise Exception
except :
print("Invalid Name")
+ 1
try:
name = input()
#your code goes here
c = len(name)
if c < 4:
raise Exception
except:
print ("Invalid Name")
else:
print("Account Created")
+ 1
This seems like a far simpler method of passing however I have a funny feeling this is NOT what they were trying to test us on:
x = input()
if len(x) < 4:
print("Invalid Name")
else:
print("Account Created")
+ 1
you can Try This if you want:
try:
name = input()
if len(name) >= 4:
print('Account Created')
else:
raise Exception
except:
print('Invalid Name')
0
Hi, is it possible to post either a link to the problem, or just your current solution to the problem and its guidelines, as I currently do not have access to this problem. I would love to help though!
0
You have to use library
My English not good but i think you want to create a messager code for send and get message
0
This is pretty simple.
You guys can try this:
try:
name = input() #Takes a string as a input
if len(name)>=4: #To find out the length of the string
print('Account Created') #Output If length of the string is more than or
equal to four.
else:
raise ValueError #If the length of the string is less than 4, raise a
Value error
except:
print("Invalid Name") #Ouptut when a Value error is raise
- 1
This is a bit shorter using the len function that worked for me
try:
name = input()
#your code goes here
if len(name) > 3:
print("Account Created")
else:
raise Exception
except:
print("Invalid Name")
- 2
Hi this is the code....
Follows:
try:
name = input(bedo)
#your code goes here
count=0
for i in name:
count+=1
if count > 3:
print("Account Created")
else:
raise Exception
except:
print("bedo")
please html js
code hack please