## How to assign an Integer to a item in list – Python card game

I am new to python and I have been having some trouble making this card game In between also known as Acey Duecy.
I have made my deck of cards using a list with the code :

``````cardname = ("ACE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE","TEN","JACK","QUEEN","KING")
suit = ( "OF CLUBS","OF DIAMONDS","OF HEARTS","OF SPADES")
deck = ()
for n in range(4):
for i in range(13):
all_card = (cardname(i) + " " + suit(n))
deck.append(all_card)
``````

After assigning a integer to the item in the list, I would like to remove the 2 cards if they are the same, but since I havent assigned them numbers and they are just strings right now the code does not work. I would also not want to have to assign each 52 cards the value manual since in my game the suits don’t matter thus its just the Ace, two, three etc.

``````first_card = deck(0)
second_card = deck(1)

if first_card == second_card :
print(".pop = False")
deck.pop(0)
deck.pop(0)
print(deck)
else :
print("They are not the same card")
$$```$$
``````

## json formatting – How to display past list items related to a column value?

In order to display a custom hover card, you need to use `customCardProps` element. See more details here. It has the following properties:

openOnEvent

• hover – card appears on mouse hover;
• click – card appears on click on the field.

directionalHint

• topCenter bottomCenter leftCenter rightCenter
• isBeakVisible – boolean. if true the card has a beak.

Sample JSON

``````{
"elmType": "div",
"txtContent": "@currentField.title",
"customCardProps": {
"openOnEvent": "hover",
"directionalHint": "rightCenter",
"isBeakVisible": true,
"formatter": {
"elmType": "div",
"style":{ "display": "block", "font-size": "15px", "padding": "10px" },
"children": [
{
"elmType": "div",
"style": { "display": "block", "width":"100%", "text-align": "center", "padding": "10px" },
"children":[
{"elmType": "div", "txtContent":"Jour 1: 11-05-2021"},
{"elmType": "div", "txtContent":"Jour 2: 12-05-2021"},
{"elmType": "div", "txtContent":"Jour 3: 13-05-2021"},
{"elmType": "div", "txtContent":"Jour 4: 14-05-2021"}
]

}
]
}
}
}
``````

In your case, you will have to create a new multiline field that would include all this information. Then, you can create a Power Automate flow that is responsible for populating this new field automatically.

This way, your JSON formula will simply need to reference a single field to display correct content.

You can make your card as fancy as you want. For example:

## sharepoint online – Get to know which field/column got update/edit in a list

Using SharePoint online.

I have custom form (CSS + JS) that add/update/delete item from a SharePoint list. This form is linked with multiple master list to provide drop downs.

Now my customer need an email notification whenever any data get added or field get updated for any existing record. That email should carry the details about field in which data get added or updated, along with the previous data.

I am not sure how to build this solution, should I create a sub-transaction list which carry replica of existing records and on every update workflow will compare it with newly update record field by field.

Or there is any solution for using SharePoint version history to achieve this.. any suggestion on it !

## list manipulation – Replace points on a grid with numbers to maintain order

I am DMing a game of DnD and one of my players is really into fear effects, which is cool, but the effect of having monsters suffer from the “panicked” condition gets tedious to render via dice rolls.

The rule is, on the battle grid the monster will run for 1 square in a random direction, then from that new position it will move into another random adjacent square. repeat this process until its moved its full move speed.

``````movespeed = 6;
points = Point(
NestList({(#((1)) + RandomChoice({-1, 0, 1})), #((2)) +
RandomChoice({-1, 0, 1})} &, {11/2, 11/2}, movespeed));
Graphics({PointSize(Large), points},
GridLines -> {Range(0, 11), Range(0, 11)},
PlotRange -> {{0, 11}, {0, 11}}, Axes -> True)
``````

I have written some code that shows me the squares the monster moves through, but I would love to replace the little black dots with numbers like “1”, “2”,…,”6″ so that I know the path it actually took.

## How to dynamically list document library titles onto a custom SharePoint page

With SharePoint Online, if I have 7 document libraries within a site, titled like so…

``````food
keys
cars-2019
cars-2020
cars-2021
pets
family
``````

…Is there a way I can dynamically list and link all my `cars_x` document library titles onto a custom SharePoint page, whenever a `cars_x` document library is created?

Or

On that custom SharePoint page, can I create a dynamic navigation menu that picks up and displays what I am trying to query…?

## How do I apply more than one conditional formatting rule using JSON to a SP Online List column?

You cannot apply multiple JSON formatting codes to single column. So, you have to manage multiple conditions/rules within same JSON.

For changing color to red when number is negative, add below code in your existing JSON:

``````...

"style": {
"color": "=if(@currentField < 0, 'red', '#323130')"
}

...
``````

Documentation: Use column formatting to customize SharePoint

## How to represent a list of entities within a table of the same entity in PostGresSql?

I have a table called user with an attribute friendsList which has to be a list of ids pointing to different users, I really have no clue how to do this(postGresql)?

## Taking parts of a list. Especially multiple chucks of a list

I would like to gather parts of a list and compile them to a new list. for example the list is:
{1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5…}. I need to able to take the 3rd through the 5th for each value such that the new list will be {1,1,1,2,2,2,3,3,3,…}.

My data out put is setup that the first column is time, second is wavelength, third is signal data. Its setup that it takes one spectrum at every time point, so the first column ends up being the same time value for the entire wavelength portion. I only need a portion of the spectrum, so I need to only select the cells I need.

What I’ve tried:`data((25;;50, 1))` resulting in only pulling the first set up time points from 25 to 50. I can’t figure out how to get the 2nd, 3rd,… time point. The wavelength section has 2048 entries, so my first guess would be to do something like:
`t1 = Downsample(data((1, 1 ;;, 1)), 2048)` `n = Range(0, Length(t1))` `data((n*2048+(25;;50),1))`

## development – Query sharepoint list data in sql server

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

## list manipulation – generate statistical table to complete and then review,How can I generate this exact table?

Good morning everyone

I want to generate a data table model with intervals (between 5 and 15) following Sturges rule
I want to generate a data table model with intervals (between 5 and 15) following the Sturges rule, for school purposes where minimum and maximum random entries between 0 and 999 are generated and distributed in intervals with equal amplitudes and closed on the left and open on the right ( a—-b( and that gives me the frequency for each interval.and all this put it in a table to be filled by the student, the idea is that in each program run a different one is generated.
and below the solution of the solved table, where xi=class mark ,fr = relative frequency ,Fi= cumulative frequency Fr% = cumulative frequency percentage and fr% = relative frequency percentage and also LI—-LS lower and upper limits of each interval.
I would appreciate it very much
I attach an image of the idea

Translated with www.DeepL.com/Translator (free version)