[Solved] I am trying to swap the two elements in the list, but after the first swap it keeps getting swapped as it fits the condition to be swapped

num = [3, 21, 5, 6, 14, 8, 14, 3] num.reverse() for i in range(len(num)-1): if num[i] % 7 == 0: num[i – 1], num[i] = num[i], num[i – 1] num.reverse() print(“The required answer :”, num) solved I am trying to swap the two elements in the list, but after the first swap it keeps … Read more

[Solved] Faulty input behavior with conditionals [closed]

Your this part of code : if (GenderSelect.lower() == “f”): print(“Name: ” + NameCreate + “\nAge: ” + str(AgeSelect) + “\nGender: Female\n”) gerror = 0 if (not(GenderSelect.lower() == “f” GenderSelect.lower() == “m”)): gerror = 1 should be : elif (GenderSelect.lower() == “f”): print(“Name: ” + NameCreate + “\nAge: ” + str(AgeSelect) + “\nGender: Female\n”) gerror … Read more

[Solved] How to read this kind of json o/p in Android?

//You can use below code for parsing this kind of jsonarray String yourResponse; JSONArray jsonarray = new JSONArray(yourResponse); for (int i = 0; i < jsonarray.lenght(); i++){ JSONObject jsonobject = jsonarray.getJSONObject(i); if(jsonobject.has(“hit”){ String hit = jsonobject.getString(“hit”); } if(jsonobject.has(“SUM(hit)”){ String sumHit = jsonobject.getString(“SUM(hit)”); } if(jsonobject.has(“COUNT(id)”){ String countID = jsonobject.getString(“COUNT(id)”); } } solved How to read this … Read more

[Solved] How to keep the text align of each other

Use display: flex for modern browsers, it’s mush easier to work with. Here is a possible solution for your problem (click on Run code snippet to see the result): .topSection { display: flex; justify-content: space-between; } .info-container { display: flex; flex-direction: column; } .info { display: flex; align-items: center; } .info img { margin-right: 8px; … Read more

[Solved] Have you an idea to send email in new way?

I don’t know adding another answer is allowed or not but let me try it. If anything is wrong kindly let me know. Hello Hope this will help. Ask question if have any confusion. First file q1.php and code for that <?php $con = mysqli_connect(‘localhost’,’root’,”,’test’); ?> <form action=’emailScript.php’ method=’post’> <div class=”control-group”> <label class=”control-label” for=”basicinput”> Select … Read more

[Solved] Create table using two dimensional array

Have you tried looking at ListViewItem and then populating a list view? If not then you can easily use a list of arrays, or even populate it in a foreach loop like bellow? foreach( var v in Muvees ) {ListViewItem movieToAdd = new ListViewItem(); movieToAdd.Text = v.movieid; movieToAdd.SubItems.Add(v.rating); movieToAdd.SubItems.Add(v.movieName); listOfMovies.Items.Add( movieToAdd ).BackColor = Color.Green;} //add … Read more

[Solved] Read each morse code from a string line [closed]

You could store the morse codes and their equivalent values in a map, split the morse string on spaces, loop over these elements and retrieve the resulting values from your map (and concatenate them together) for your final result this is an example showing the decoded SOS ‘… — …’ #include <string> #include <cstring> #include … Read more