Skip to content

Query, Discussion & Bug Report #3

Open
@darkprinx

Description

@darkprinx
Owner

Hello Guys

If anyone wants to -

  • Share opinion
  • Ideas
  • Have query
  • Find mistake

Please feel free to write it down and discuss here.


Sharing new questions and solutions are warmly welcome. Be a proud contributor of this repository by just making a pull request of your changes.

Activity

changed the title [-]Question, Discussion & Bug Report[/-] [+]Query, Discussion & Bug Report[/+] on Jan 16, 2019
added
bugSomething isn't working
enhancementNew feature or request
help wantedExtra attention is needed
questionFurther information is requested
on Jan 16, 2019
Amitewu

Amitewu commented on Apr 16, 2019

@Amitewu

Solution Can be of question 14:
string=input("Enter the sentense")
upper=0
lower=0
for x in string:
if x.isupper()==True:
upper+=1
if x.islower()==True:
lower+=1

print("UPPER CASE: ",upper)
print("LOWER CASE: ",lower)

darkprinx

darkprinx commented on Apr 17, 2019

@darkprinx
OwnerAuthor

Solution Can be of question 14:
string=input("Enter the sentense")
upper=0
lower=0
for x in string:
if x.isupper()==True:
upper+=1
if x.islower()==True:
lower+=1

print("UPPER CASE: ",upper)
print("LOWER CASE: ",lower)

Added. Thank you :)

Amitewu

Amitewu commented on Apr 19, 2019

@Amitewu

In problem 17 How do I terminate this while true condition?????

darkprinx

darkprinx commented on Apr 19, 2019

@darkprinx
OwnerAuthor

Just check whether the input is empty or not.

sam1037

sam1037 commented on Jul 22, 2019

@sam1037

In answer 14, your solution 2, what is '{0}' and '{1}'? I don't understand.

darkprinx

darkprinx commented on Jul 22, 2019

@darkprinx
OwnerAuthor

In python, while printing a dynamic value inside a string, there are several ways to format the output string. For example, let's say you have two variables a = 10 and b = 20 and you want to output something like this,

The sum of 10 and 20 is 30

You can do this by writing it in this way,

print("The sum of {0} and {1} is {2}".format(a, b, a + b))

Here 0, 1, 2 inside '{ }' represents the order of a, b and a+b respectively.

However, If the code is written in this way,

print("The sum of {1} and {0} is {2}".format(a, b, a + b))

then the output will be like,

The sum of 20 and 10 is 30

But printing in this way is not very much necessary. It can be also written in this way,

print("The sum of {} and {} is {}".format(a, b, a + b))

which will give the same output as wanted. I was new to python at that timeline so that I learned and used in {0}, {1} style which is actually not mandatory at all.

Thank you :)

sam1037

sam1037 commented on Jul 23, 2019

@sam1037

Thank you for teaching me.

Amitewu

Amitewu commented on Jul 29, 2019

@Amitewu

#This could be the ans for 16
x=input().split(",")
ans=list(filter(lambda x : int(x)%2!=0 ,x))
print(",".join(ans))

darkprinx

darkprinx commented on Jul 29, 2019

@darkprinx
OwnerAuthor

#This could be the ans for 16
x=input().split(",")
ans=list(filter(lambda x : int(x)%2!=0 ,x))
print(",".join(ans))

Added to question# 16

ArturOle

ArturOle commented on Sep 17, 2019

@ArturOle

Question 38 ans proposition:

tup = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
lt = int(len(tup)/2)
print(tup[:lt], tup[lt:])

208 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requesthelp wantedExtra attention is neededquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @NikolayEm@lcastrooliveira@RanjanParida@mr-rockgod@darkprinx

        Issue actions

          Query, Discussion & Bug Report · Issue #3 · darkprinx/break-the-ice-with-python