We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 711abae commit b7e9dc4Copy full SHA for b7e9dc4
Hemant-60/c1.py
@@ -0,0 +1,41 @@
1
+def print_without_spaces(some_str):
2
+ flag = 0
3
+ other_str=""
4
+ for i in some_str:
5
+ if flag == 0 and i!=" ":
6
+ other_str+=i
7
+ elif i==" ":
8
+ flag=1
9
+ elif flag==1 and i!=" ":
10
+ flag=0
11
+ i=i.upper()
12
13
+
14
+ return other_str
15
+def print_with_spaces(some_str):
16
17
18
19
+ if i>="A" and i<="Z":
20
21
22
+ if flag==0 and i!=" ":
23
24
25
26
+ if flag == 1:
27
+ i=i.lower()
28
29
+ other_str+=" "
30
31
32
+ other_str = other_str[1].capitalize()+other_str[2:]
33
34
35
36
37
+some_str=input("Enter the string : ")
38
+some_str=print_without_spaces(some_str)
39
+print(some_str)
40
+print(print_with_spaces(some_str))
41
0 commit comments